Return decode error in GError if pointer to GError structure provided
[claws.git] / src / procmime.c
index c26aa117e0f3acc6f96ce4033d9db1c9edfe4857..54b023d8dd75392e6e9cf2b87052a5ced2378f74 100644 (file)
@@ -2789,8 +2789,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);