[glib/portal] Avoid a critical



commit 322e65894aab41c9519b1440216388c8ae43988a
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 23 10:16:15 2016 -0400

    Avoid a critical
    
    The key might not be present in flatpak-info. Deal with that.

 gio/gportalsupport.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gio/gportalsupport.c b/gio/gportalsupport.c
index d7ba523..a14acd9 100644
--- a/gio/gportalsupport.c
+++ b/gio/gportalsupport.c
@@ -57,8 +57,11 @@ glib_network_available_in_sandbox (void)
       char **shared = NULL;
 
       shared = g_key_file_get_string_list (keyfile, "Context", "shared", NULL, NULL);
-      available = g_strv_contains ((const char * const *)shared, "network");
-      g_strfreev (shared);
+      if (shared)
+        {
+          available = g_strv_contains ((const char * const *)shared, "network");
+          g_strfreev (shared);
+        }
     }
 
   g_key_file_free (keyfile);


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