applications: Properly protect against NULL app_id

The 'app_id' variable can be NULL, and g_str_has_prefix() does
not particularly enjoy that.
This commit is contained in:
Georges Basile Stavracas Neto 2022-01-20 18:55:03 -03:00
parent de26f9a8f5
commit 00cb6386e4

View file

@ -794,7 +794,7 @@ add_static_permissions (CcApplicationsPanel *self,
gint added = 0;
g_autofree gchar *text = NULL;
if (!g_str_has_prefix (app_id, PORTAL_SNAP_PREFIX))
if (app_id && !g_str_has_prefix (app_id, PORTAL_SNAP_PREFIX))
keyfile = get_flatpak_metadata (app_id);
if (keyfile == NULL)
return FALSE;