Commit 295f345b authored by Michael Natterer's avatar Michael Natterer 😴

Guard against g_file_info_get_icon() returning NULL

It can return NULL, but should not for a proper gvfs backend; add a
returning NULL.
parent cd7abf24
......@@ -165,9 +165,8 @@ gimp_view_renderer_imagefile_get_icon (GimpImagefile *imagefile,
if (! pixbuf)
{
GFile *file;
GFileInfo *file_info;
GtkIconInfo *info;
GFile *file;
GFileInfo *file_info;
file = g_file_new_for_uri (gimp_object_get_name (imagefile));
file_info = g_file_query_info (file, "standard::icon", 0, NULL, NULL);
......@@ -176,8 +175,19 @@ gimp_view_renderer_imagefile_get_icon (GimpImagefile *imagefile,
{
GIcon *icon = g_file_info_get_icon (file_info);
info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, size, 0);
pixbuf = gtk_icon_info_load_icon (info, NULL);
if (icon)
{
GtkIconInfo *info;
info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, size, 0);
pixbuf = gtk_icon_info_load_icon (info, NULL);
}
else
{
#ifdef GIMP_UNSTABLE
g_printerr ("no icon for: %s\n", gimp_object_get_name (imagefile));
#endif
}
g_object_unref (file_info);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment