[gnome-software] snap: Fix warning when NULL icon received



commit 334fa666692ef671b8af82a74b10e686bc37fe41
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Nov 24 15:33:04 2017 +1300

    snap: Fix warning when NULL icon received

 plugins/snap/gs-plugin-snap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 5db7243..0d3caa8 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -568,7 +568,7 @@ static gboolean
 load_icon (GsPlugin *plugin, SnapdClient *client, GsApp *app, const gchar *icon_url, GCancellable 
*cancellable, GError **error)
 {
        /* icon is either loaded from snapd or from a URL */
-       if (g_str_has_prefix (icon_url, "/")) {
+       if (icon_url != NULL && g_str_has_prefix (icon_url, "/")) {
                g_autoptr(SnapdIcon) icon = NULL;
 
                icon = snapd_client_get_icon_sync (client, gs_app_get_id (app), cancellable, error);


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