[gnome-software/gnome-3-26] packagekit: Fix crash if reporting progress with no current application



commit cdb27f1eb91e66700b6ab2d76972661218b40993
Author: Richard Hughes <richard hughsie com>
Date:   Tue Sep 12 16:06:25 2017 +0100

    packagekit: Fix crash if reporting progress with no current application

 plugins/packagekit/gs-plugin-packagekit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c
index d1e655d..97ba9de 100644
--- a/plugins/packagekit/gs-plugin-packagekit.c
+++ b/plugins/packagekit/gs-plugin-packagekit.c
@@ -97,9 +97,10 @@ gs_plugin_packagekit_progress_cb (PkProgress *progress,
 
        /* Only go from TRUE to FALSE - it doesn't make sense for a package
         * install to become uncancellable later on */
-       if (gs_app_get_allow_cancel (data->app))
+       if (data->app != NULL && gs_app_get_allow_cancel (data->app)) {
                gs_app_set_allow_cancel (data->app,
                                         pk_progress_get_allow_cancel (progress));
+       }
 }
 
 static gboolean


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