[gnome-control-center/gbsneto/applications-panel-cleanups] applications: Properly protect against NULL app_id



commit 00cb6386e4143228f53516ac2af7c39f552ff2a2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Jan 20 18:55:03 2022 -0300

    applications: Properly protect against NULL app_id
    
    The 'app_id' variable can be NULL, and g_str_has_prefix() does
    not particularly enjoy that.

 panels/applications/cc-applications-panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 8c70256ee..6a17b6086 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]