From a12b691b76c6b1f77be5a152211ee83de6fe104b Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Mon, 17 Oct 2016 13:02:26 +0200 Subject: [PATCH] gtkicontheme: check if the context quark string is not null On windows you might not have a theme installed by default which means that when trying to create the context quark it will fail. If then we try to replace a NULL key in the hash table it will crash. https://bugzilla.gnome.org/show_bug.cgi?id=769859 --- gtk/gtkicontheme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index a2255d4933..e31c75a792 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -3179,7 +3179,8 @@ theme_list_contexts (IconTheme *theme, dir = l->data; context = g_quark_to_string (dir->context); - g_hash_table_replace (contexts, (gpointer) context, NULL); + if (context != NULL) + g_hash_table_replace (contexts, (gpointer) context, NULL); l = l->next; }