[gtk] inspector: Handle case where there's no default application



commit be2609a2715e0319c8e2c0ed42cab4be74b1cf57
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 19 04:28:09 2018 +0200

    inspector: Handle case where there's no default application

 gtk/inspector/object-tree.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index ff2d0d060e..8df104f86b 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -1113,11 +1113,14 @@ create_root_model (void)
   GtkFilterListModel *filter;
   GtkFlattenListModel *flatten;
   GListStore *list, *special;
+  gpointer item;
 
   list = g_list_store_new (G_TYPE_LIST_MODEL);
 
   special = g_list_store_new (G_TYPE_OBJECT);
-  g_list_store_append (special, g_application_get_default ());
+  item = g_application_get_default ();
+  if (item)
+    g_list_store_append (special, item);
   g_list_store_append (special, gtk_settings_get_default ());
   g_list_store_append (list, special);
   g_object_unref (special);


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