Blob Blame Raw
From cdc5824e4488d419616cdfaa87ac5f6cf2a4dfea Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Fri, 17 Jul 2015 10:42:01 +0200
Subject: [PATCH] applet: do not crash if the new problem has no command_line

Related: rhbz#1243791

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/applet/applet.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/applet/applet.c b/src/applet/applet.c
index 296e1b4..5bdedc1 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -661,7 +661,11 @@ static void notify_problem_list(GList *problems)
         app = problem_create_app_from_env (problem_info_get_env(pi), problem_info_get_pid(pi));
 
         if (!app)
-            app = problem_create_app_from_cmdline (problem_info_get_command_line(pi));
+        {
+            const char *const cmd_line = problem_info_get_command_line(pi);
+            if (cmd_line != NULL)
+                app = problem_create_app_from_cmdline(cmd_line);
+        }
 
         /* For each problem we'll need to know:
          * - Whether or not the crash happened in an “app”
-- 
2.4.3