When g_spawn_sync () fails,
`standard_output` and `standard_error` may not be set.
This commit makes to check whether or not the value is valid.
// Always get the pointer to the stdout/stderr messages
int exit_status = ly_run_command (argv, &standard_output, &standard_error);
// Always get the pointer to the stdout/stderr messages
int exit_status = ly_run_command (argv, &standard_output, &standard_error);
- // Print out stdout and stderr only in debug mode
- debug_output (string ("\n") + standard_output + standard_error, true);
+ if (standard_output && standard_error)
+ {
+ // Print out stdout and stderr only in debug mode
+ debug_output (string ("\n") + standard_output + standard_error, true);
+ }
g_free (standard_error);
g_free (standard_output);
g_free (standard_error);
g_free (standard_output);