If error is NULL print a static message instead
authorMichael Rasmussen <mir@datanom.net>
Wed, 3 Jul 2019 18:35:17 +0000 (20:35 +0200)
committerMichael Rasmussen <mir@datanom.net>
Wed, 3 Jul 2019 18:35:17 +0000 (20:35 +0200)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
src/plugins/litehtml_viewer/lh_widget.cpp

index 436bb76fe47295ef9fd6687267889192c48f7085..8e8e808f94c4fc6ad3f86f8c0ae660d8e31f7410 100644 (file)
@@ -456,8 +456,12 @@ GdkPixbuf *lh_widget::get_local_image(const litehtml::tstring url) const
 
                        stream = procmime_get_part_as_inputstream(p, &error);
                        if (error != NULL || stream == NULL) {
-                               g_warning("Couldn't get image MIME part: %s\n", error->message);
-                               g_error_free(error);
+                               if (error != NULL) {
+                                       g_warning("Couldn't get image MIME part: %s\n", error->message);
+                                       g_error_free(error);
+                               } else {
+                                       g_warning("Could not decode MIME part\n");
+                               }
                                return NULL;
                        }