From 9df4bd29ea98473bd22ae122a46426c6ea391f86 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 1 Aug 2022 15:49:56 +0200 Subject: Check for error before trying to append it Related to https://github.com/profanity-im/profanity/issues/1738 --- src/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 3a1b9cc4..be010d8d 100644 --- a/src/common.c +++ b/src/common.c @@ -465,7 +465,7 @@ call_external(gchar** argv, gchar** std_out, gchar** std_err) if (!spawn_result || !g_spawn_check_exit_status(exit_status, &spawn_error)) { 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_error_free(spawn_error); } -- cgit 1.4.1-2-gfad0