From 5962ee79390a34e8b550bc6deb21b402182ca11e Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 31 Jul 2020 15:21:32 +0200 Subject: [PATCH] startup: Fix possible crash in startup notifications A GAppInfo is not guaranteed to have a filename or an application (or rather a desktop ID). Add a check for application_id to be non-NULL before trying to call sn_launcher_set_application_id, which would crash otherwise. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1392 --- src/x11/meta-startup-notification-x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11/meta-startup-notification-x11.c b/src/x11/meta-startup-notification-x11.c index 045ee7768..da80f5e14 100644 --- a/src/x11/meta-startup-notification-x11.c +++ b/src/x11/meta-startup-notification-x11.c @@ -355,7 +355,7 @@ meta_x11_startup_notification_launch (MetaX11Display *x11_display, (gpointer *) &func); } - if (func) + if (func && application_id) func (sn_launcher, application_id); g_module_close (self);