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 committed by Robert Mader
parent a4f1c5f330
commit 5962ee7939

View File

@ -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);