[gnome-software] snap: Handle error if snapd_client_find_refreshable_sync fails



commit 02fc9ad30d1925f6abfd1dcd600e61b1fac747ac
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Feb 10 12:20:48 2020 +1300

    snap: Handle error if snapd_client_find_refreshable_sync fails

 plugins/snap/gs-plugin-snap.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 0633516e..3abc82e1 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -1230,13 +1230,18 @@ gs_plugin_add_updates (GsPlugin *plugin,
 {
        g_autoptr(GPtrArray) apps = NULL;
        g_autoptr(SnapdClient) client = NULL;
+       g_autoptr(GError) error_local = NULL;
 
        client = get_client (plugin, error);
        if (client == NULL)
                return FALSE;
 
        /* Get the list of refreshable snaps */
-       apps = snapd_client_find_refreshable_sync (client, cancellable, error);
+       apps = snapd_client_find_refreshable_sync (client, cancellable, &error_local);
+       if (apps == NULL) {
+               g_warning ("Failed to find refreshable snaps: %s", error_local->message);
+               return TRUE;
+       }
 
        for (guint i = 0; i < apps->len; i++) {
                SnapdSnap *snap = g_ptr_array_index (apps, i);


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