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 cc641c6..fe35130 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);