From 2736e87ecd64e2e19731e774bcde3ee315bfef38 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 4 Feb 2022 14:53:39 +0000 Subject: [PATCH] gs-plugin-loader: Fix NULL reference It turns out `app` can be `NULL` here, so guard against `g_object_ref (NULL)`. Signed-off-by: Philip Withnall --- lib/gs-plugin-loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c index 8b0dc7537..6c65e41fa 100644 --- a/lib/gs-plugin-loader.c +++ b/lib/gs-plugin-loader.c @@ -377,7 +377,8 @@ gs_plugin_loader_claim_error (GsPluginLoader *plugin_loader, } /* set the app and origin IDs if we managed to scrape them from the error above */ - event_app = g_object_ref (app); + if (app != NULL) + event_app = g_object_ref (app); event_origin = NULL; if (plugin != NULL && as_utils_data_id_valid (app_id)) { -- GitLab