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
This commit is contained in:
Benjamin Berg 2020-07-31 15:21:32 +02:00
parent 34579d71cc
commit 07aef68670

View File

@ -355,7 +355,7 @@ meta_x11_startup_notification_launch (MetaX11Display *x11_display,
(gpointer *) &func); (gpointer *) &func);
} }
if (func) if (func && application_id)
func (sn_launcher, application_id); func (sn_launcher, application_id);
g_module_close (self); g_module_close (self);