1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Check for error before trying to append it

Related to https://github.com/profanity-im/profanity/issues/1738
This commit is contained in:
Michael Vetter 2022-08-01 15:49:56 +02:00
parent 0e02cc3cf6
commit 9df4bd29ea

View File

@ -465,7 +465,7 @@ call_external(gchar** argv, gchar** std_out, gchar** std_err)
if (!spawn_result if (!spawn_result
|| !g_spawn_check_exit_status(exit_status, &spawn_error)) { || !g_spawn_check_exit_status(exit_status, &spawn_error)) {
gchar* cmd = g_strjoinv(" ", argv); gchar* cmd = g_strjoinv(" ", argv);
log_error("Spawning '%s' failed with '%s'.", cmd, spawn_error->message); log_error("Spawning '%s' failed with '%s'.", cmd, (spawn_error && spawn_error->message) ? spawn_error->message : "No error given");
g_free(cmd); g_free(cmd);
g_error_free(spawn_error); g_error_free(spawn_error);
} }