[gnome-software] plugin event: trivial: Try harder to avoid returning NULL unique ID



commit 03feb124bed19417796642d45aa883b14d21f145
Author: Kalev Lember <klember redhat com>
Date:   Tue Apr 30 14:02:21 2019 +0200

    plugin event: trivial: Try harder to avoid returning NULL unique ID

 lib/gs-plugin-event.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-plugin-event.c b/lib/gs-plugin-event.c
index 2e292c0a..cf122561 100644
--- a/lib/gs-plugin-event.c
+++ b/lib/gs-plugin-event.c
@@ -157,10 +157,14 @@ const gchar *
 gs_plugin_event_get_unique_id (GsPluginEvent *event)
 {
        /* just proxy */
-       if (event->origin != NULL)
+       if (event->origin != NULL &&
+           gs_app_get_unique_id (event->origin) != NULL) {
                return gs_app_get_unique_id (event->origin);
-       if (event->app != NULL)
+       }
+       if (event->app != NULL &&
+           gs_app_get_unique_id (event->app) != NULL) {
                return gs_app_get_unique_id (event->app);
+       }
 
        /* generate from error */
        if (event->error != NULL) {


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