Return decode error in GError if pointer to GError structure provided
authorMichael Rasmussen <mir@datanom.net>
Sun, 7 Jul 2019 17:06:34 +0000 (19:06 +0200)
committerMichael Rasmussen <mir@datanom.net>
Sun, 7 Jul 2019 17:06:34 +0000 (19:06 +0200)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
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);
                *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;
                return NULL;
+       }
 
        pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, error);
        g_object_unref(stream);
 
        pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, error);
        g_object_unref(stream);