GtkIconTheme: Be more careful when warning

It sucks when printing a warning causes gnome-shell to crash,
so be more careful about icon names being NULL here.
This commit is contained in:
Matthias Clasen 2014-06-23 12:13:22 -04:00
parent 12a40cf8a6
commit 30982b6d4e

View File

@ -4208,12 +4208,12 @@ gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
g_object_unref (pixbuf);
}
if (icon_info->dir_type != ICON_THEME_DIR_SCALABLE)
g_warning ("Symbolic icon %s is not in a scalable icon theme directory",
icon_info->key.icon_names[0]);
if (icon_info->dir_type == ICON_THEME_DIR_UNTHEMED)
g_warning ("Symbolic icon %s is not in an icon theme directory",
icon_info->key.icon_names ? icon_info->key.icon_names[0] : icon_info->filename);
else if (icon_info->dir_size * icon_info->dir_scale != icon_info->symbolic_size)
g_warning ("Symbolic icon %s of size %d is in an icon theme directory of size %d",
icon_info->key.icon_names[0],
icon_info->key.icon_names ? icon_info->key.icon_names[0] : icon_info->filename,
icon_info->symbolic_size,
icon_info->dir_size * icon_info->dir_scale);