[gnome-software] Do not show an update for apps whose latest flatpak commit is NULL



commit 94b2aa1336563ca27cf4292a59035134a4dd4e52
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Wed Sep 14 13:21:51 2016 -0700

    Do not show an update for apps whose latest flatpak commit is NULL
    
    The logic for setting an app as updatable works by comparing the current
    commit of an app with the latest one available.
    However, if an app no longer exists in its remote, then the latest
    commit is being set as NULL, thus resulting in a wrong update for the
    app in GNOME Software.
    
    This patch simply checks if the latest commit of an app is not NULL
    before comparing the commits in question.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771449

 src/plugins/gs-flatpak.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index b87ffb7..c030d43 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -943,6 +943,11 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                /* check the application has already been downloaded */
                commit = flatpak_ref_get_commit (FLATPAK_REF (xref));
                latest_commit = flatpak_installed_ref_get_latest_commit (xref);
+               if (latest_commit == NULL) {
+                       g_debug ("could not get latest commit for %s",
+                                flatpak_ref_get_name (FLATPAK_REF (xref)));
+                       continue;
+               }
                if (g_strcmp0 (commit, latest_commit) == 0) {
                        g_debug ("no downloaded update for %s",
                                 flatpak_ref_get_name (FLATPAK_REF (xref)));


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