[gnome-software/gnome-3-34] snap: Don't try to get alternatives for non-snaps



commit 56d95cd9d0becefc85e654192fdc6f5142ecc82e
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Nov 28 12:58:11 2019 +1300

    snap: Don't try to get alternatives for non-snaps
    
    That's likely to crash...

 plugins/snap/gs-plugin-snap.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 4d038e63..f7072930 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -585,6 +585,10 @@ gs_plugin_add_alternates (GsPlugin *plugin,
        GPtrArray *channels;
        g_autoptr(GPtrArray) sorted_channels = NULL;
 
+       /* not us */
+       if (g_strcmp0 (gs_app_get_management_plugin (app), "snap") != 0)
+               return TRUE;
+
        snap = get_store_snap (plugin, gs_app_get_metadata_item (app, "snap::name"), TRUE, cancellable, NULL);
        if (snap == NULL) {
                g_warning ("Failed to get store snap %s\n", gs_app_get_metadata_item (app, "snap::name"));


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