icontheme: fix crash on directories without a Context key

Backported from GTK 3 commit 21cd322df9 by Emmanuele Bassi.
This commit is contained in:
Daemonratte 2026-10-15 11:46:11 +02:00
commit 7dd2375e9f

View file

@ -2327,8 +2327,12 @@ theme_list_contexts (IconTheme *theme,
{
dir = l->data;
context = g_quark_to_string (dir->context);
g_hash_table_replace (contexts, (gpointer) context, NULL);
/* the Context key is optional */
if (dir->context != 0)
{
context = g_quark_to_string (dir->context);
g_hash_table_replace (contexts, (gpointer) context, NULL);
}
l = l->next;
}