[gnome-software/gnome-3-10] Don't emit a critical warning if there are no AppStream icons



commit 7bc1a057ce4d8f294db0a80d92e155a4ac2e6344
Author: Richard Hughes <richard hughsie com>
Date:   Wed Oct 16 11:45:01 2013 +0100

    Don't emit a critical warning if there are no AppStream icons

 src/plugins/gs-plugin-appstream.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index c93b26f..12c0081 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -51,14 +51,18 @@ gs_plugin_appstream_icons_are_new_layout (const gchar *dirname)
 {
        GDir *dir;
        const gchar *tmp;
-       gboolean ret;
+       gboolean ret = TRUE;
 
        /* simply test if the first item is a file and if not, the icons are
         * in the new /var/cache/app-info/icons/${repo}/gimp.png layout */
        dir = g_dir_open (dirname, 0, NULL);
+       if (dir == NULL)
+               goto out;
        tmp = g_dir_read_name (dir);
        ret = g_strstr_len (tmp, -1, ".") == NULL;
-       g_dir_close (dir);
+out:
+       if (dir != NULL)
+               g_dir_close (dir);
        return ret;
 }
 


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