[gnome-software] Don't emit a critical warning if there are no AppStream icons
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't emit a critical warning if there are no AppStream icons
- Date: Wed, 16 Oct 2013 13:25:10 +0000 (UTC)
commit 559ad86f025eecabb0e2c14c22e613691b51bf3a
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 429495f..24d83e4 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -53,14 +53,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]