commit d578448b2b5c9bf4f7a70906ee3230be5baba884
parent dd4c4e5152235f9f4f319cc9fdad9227ebf688c9
Author: Ricardo Mones <ricardo@mones.org>
Date: Sat, 2 Dec 2023 21:11:51 +0100
Distinguish messages and remove unnecessary goto
Diffstat:
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp
@@ -35,22 +35,20 @@ static GdkPixbuf *lh_get_image(const char *url)
if (error || !image) {
if (error) {
+ g_warning("lh_get_image: Could not load URL for '%s': %s",
+ url, error->message);
+ g_clear_error(&error);
+ }
+ } else {
+ pixbuf = gdk_pixbuf_new_from_stream(image, NULL, &error);
+ if (error) {
g_warning("lh_get_image: Could not create pixbuf for '%s': %s",
url, error->message);
+ pixbuf = NULL;
g_clear_error(&error);
}
- goto theend;
- }
-
- pixbuf = gdk_pixbuf_new_from_stream(image, NULL, &error);
- if (error) {
- g_warning("lh_get_image: Could not create pixbuf for '%s': %s",
- url, error->message);
- pixbuf = NULL;
- g_clear_error(&error);
}
-theend:
delete http_loader;
return pixbuf;