filechooser: Don't crash if invalid thumbnails exist

Failing to load a thumbnail returns a NULL pixbuf. Since the hidpi
patches this wasn't checked when creating the surface. Result: assertion
failure.

https://bugzilla.gnome.org/show_bug.cgi?id=719977
This commit is contained in:
Benjamin Otte 2013-12-06 19:15:24 +01:00
parent 904bc27250
commit 860138b302

View File

@ -813,10 +813,13 @@ _gtk_file_info_render_icon (GFileInfo *info,
icon_size*scale, icon_size*scale, icon_size*scale, icon_size*scale,
NULL); NULL);
if (pixbuf != NULL)
{
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale,
gtk_widget_get_window (widget)); gtk_widget_get_window (widget));
g_object_unref (pixbuf); g_object_unref (pixbuf);
} }
}
if (!surface) if (!surface)
{ {