]> Pileus Git - ~andy/gtk/blobdiff - gdk/x11/gdkapplaunchcontext-x11.c
Fix a segfault if the GAppInfo does not have an icon
[~andy/gtk] / gdk / x11 / gdkapplaunchcontext-x11.c
index ff4f1cd183cc46c8a2e0e1c13b5d158c8f8d48c1..825be753e4d886d217d272c5c3d56a935655ec05 100644 (file)
@@ -328,13 +328,15 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
       if (icon == NULL)
         {
           icon = g_app_info_get_icon (info);
-          g_object_ref (icon);
+          if (icon != NULL)
+            g_object_ref (icon);
         }
 
-      if (icon)
-        icon_name = gicon_to_string (icon);
-
-      g_object_unref (icon);
+      if (icon != NULL)
+        {
+          icon_name = gicon_to_string (icon);
+          g_object_unref (icon);
+        }
     }
 
   binary_name = g_app_info_get_executable (info);