Commit 833eb3ce authored by Laurent Bigonville's avatar Laurent Bigonville
Browse files

d/p/snap-Don-t-try-to-get-alternatives-for-non-snaps.patch: Do not try to...

d/p/snap-Don-t-try-to-get-alternatives-for-non-snaps.patch: Do not try to manage alternative for non-snaps applications (Closes: #947237)
parent a374bbab
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,8 +4,10 @@ gnome-software (3.34.2-2) UNRELEASED; urgency=medium
    this is allowed in the debian policy
  * d/p/0001-gs-appstream-Fix-loading-of-icons-from-AppStream-YAM.patch:
    Fix loading of icons from AppStream YAM (Thanks to Robert Ancell)
  * d/p/snap-Don-t-try-to-get-alternatives-for-non-snaps.patch: Do not try to
    manage alternative for non-snaps applications (Closes: #947237)

 -- Laurent Bigonville <bigon@debian.org>  Tue, 21 Jan 2020 09:33:56 +0100
 -- Laurent Bigonville <bigon@debian.org>  Tue, 21 Jan 2020 09:54:13 +0100

gnome-software (3.34.2-1) unstable; urgency=medium

+1 −0
Original line number Diff line number Diff line
0001-gs-appstream-Fix-loading-of-icons-from-AppStream-YAM.patch
#0011-Support-snap-channels.patch
0021-details-Use-custom-icon-for-verified-developers.patch
snap-Don-t-try-to-get-alternatives-for-non-snaps.patch
+24 −0
Original line number Diff line number Diff line
From: Robert Ancell <robert.ancell@canonical.com>
Date: Thu, 28 Nov 2019 12:58:11 +1300
Subject: 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 6ef850a..af520dd 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -589,6 +589,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"));