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



commit 2498f9318bc7847fd22f682fd418d9d94b453ef5
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]