[gnome-desktop] thumbnailer: Correctly check for errors



commit fef06300534883ed27321bb4cda19309ef028fe7
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Aug 24 05:37:28 2013 +0200

    thumbnailer: Correctly check for errors
    
    By checking the retval, not whether error was set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699252

 libgnome-desktop/gnome-desktop-thumbnail.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index fb51b80..14e4131 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
@@ -398,13 +398,11 @@ _gdk_pixbuf_new_from_uri_at_scale (const char *uri,
                                          sizeof (buffer),
                                          NULL,
                                          &error);
-        if (error != NULL) {
+        if (bytes_read == -1) {
             g_warning ("Error reading from %s: %s", uri, error->message);
             g_clear_error (&error);
+            break;
         }
-       if (bytes_read == -1) {
-           break;
-       }
        result = TRUE;
        if (bytes_read == 0) {
            break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]