cssimageurl: Explicitly check for local_error != NULL
authorTimm Bäder <mail@baedert.org>
Sat, 18 Sep 2021 11:08:46 +0000 (13:08 +0200)
committerTimm Bäder <mail@baedert.org>
Sat, 18 Sep 2021 11:08:46 +0000 (13:08 +0200)
This should always be the case since gdk_texture_new_from_file should
always set the error when it returns NULL, but make it explicit anyway.

gtk/gtkcssimageurl.c

index 15d56ac21e91c96d9fcb5f9efd5008a7c0b6e150..8c9253744ba388686bd32b6d27ad0984ef687d03 100644 (file)
@@ -59,7 +59,7 @@ gtk_css_image_url_load_image (GtkCssImageUrl  *url,
 
   if (texture == NULL)
     {
-      if (error)
+      if (error && local_error)
         {
           char *uri;
 
@@ -70,7 +70,7 @@ gtk_css_image_url_load_image (GtkCssImageUrl  *url,
                        "Error loading image '%s': %s", uri, local_error->message);
           g_free (uri);
        }
-      
+
       url->loaded_image = gtk_css_image_invalid_new ();
     }
   else