Return decode error in GError if pointer to GError structure provided
[claws.git] / src / procmime.c
index cc641c6f3f1585962f494cf881a21a6743070e85..fe3513055ca311d85407aa48e2f7fd8f36d1a586 100644 (file)
@@ -2750,8 +2750,11 @@ GdkPixbuf *procmime_get_part_as_pixbuf(MimeInfo *mimeinfo, GError **error)
                *error = NULL;
 
        stream = procmime_get_part_as_inputstream(mimeinfo);
-       if (stream == NULL)
+       if (stream == NULL) {
+               if (error)
+                       *error = g_error_new_literal(G_FILE_ERROR, -1, _("Could not decode part"));
                return NULL;
+       }
 
        pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, error);
        g_object_unref(stream);