diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c index 20db4abe68..8796cc3b9e 100644 --- a/gdk/x11/gdkapplaunchcontext-x11.c +++ b/gdk/x11/gdkapplaunchcontext-x11.c @@ -340,13 +340,15 @@ _gdk_windowing_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);