commit 4d6d31e8c5e6b16dabd253e3b70eaf1aa02a0313
parent 32e4bbe817586dfabb3e83265ecbcb45b3eadf3e
Author: Colin Leroy <colin@colino.net>
Date: Sun, 7 Jul 2019 12:21:50 +0200
procmime_get_part_as_pixbuf: set error if we can't decode part.
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/procmime.c b/src/procmime.c
@@ -2785,19 +2785,22 @@ GdkPixbuf *procmime_get_part_as_pixbuf(MimeInfo *mimeinfo, GError **error)
GdkPixbuf *pixbuf;
GInputStream *stream;
- *error = NULL;
+ if (error)
+ *error = NULL;
stream = procmime_get_part_as_inputstream(mimeinfo);
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);
- if (*error != NULL) {
+ if (*error != NULL)
return NULL;
- }
+
return pixbuf;
}