summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmate-desktop/mate-desktop-thumbnail.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libmate-desktop/mate-desktop-thumbnail.c b/libmate-desktop/mate-desktop-thumbnail.c
index d974b37..4d287fb 100644
--- a/libmate-desktop/mate-desktop-thumbnail.c
+++ b/libmate-desktop/mate-desktop-thumbnail.c
@@ -303,13 +303,11 @@ create_loader (GFile *file,
const guchar *data,
gsize size)
{
- GdkPixbufLoader *loader;
+ GdkPixbufLoader *loader = NULL;
GError *error = NULL;
char *mime_type;
char *filename;
- loader = NULL;
-
/* need to specify the type here because the gdk_pixbuf_loader_write
doesn't have access to the filename in order to correct detect
the image type. */
@@ -321,7 +319,7 @@ create_loader (GFile *file,
loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, &error);
}
- if (loader == NULL) {
+ if (loader == NULL && error != NULL) {
g_warning ("Unable to create loader for mime type %s: %s", mime_type, error->message);
g_clear_error (&error);
loader = gdk_pixbuf_loader_new ();