[gnome-software] Do not crash when sending progress reports while refreshing



commit e04d4e5e05da7c02a20cf216ae3e7436794b3ee3
Author: Richard Hughes <richard hughsie com>
Date:   Wed May 10 10:42:25 2017 +0100

    Do not crash when sending progress reports while refreshing
    
    If gs_flatpak_create_installed() fails to build a fake GsApp (e.g. if the user
    is refreshing the metadata for an application that is not 'current') then we'll
    explode when we try to set the progress on a NULL GsApp.
    
    Should fix: https://retrace.fedoraproject.org/faf/reports/1666599/

 plugins/flatpak/gs-flatpak.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 65565ad..3cf6bdc 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1166,6 +1166,8 @@ gs_flatpak_progress_cb (const gchar *status,
                        gpointer user_data)
 {
        GsApp *app = GS_APP (user_data);
+       if (app == NULL)
+               return;
        gs_app_set_progress (app, progress);
 }
 
@@ -1215,8 +1217,7 @@ gs_flatpak_refresh (GsFlatpak *self,
                g_autoptr(FlatpakInstalledRef) xref2 = NULL;
 
                /* try to create a GsApp so we can do progress reporting */
-               app = gs_flatpak_create_installed (self, xref,
-                                                  NULL);
+               app = gs_flatpak_create_installed (self, xref, NULL);
 
                /* fetch but do not deploy */
                g_debug ("pulling update for %s",


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