From 3d30f160d33ca7dd1f3e2ebf731585297f3f5ea6 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 26 Aug 2020 12:38:57 +0200 Subject: grilo-test-ui: Fix crash if app couldn't get on the bus If the application couldn't own a name on the session bus, then it would never setup its UI, and view would be a NULL pointer which we'd dereference, and crash. Exit early from cleanup function if the view was never setup. --- tools/grilo-test-ui/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c index 17e5389..1fabf76 100644 --- a/tools/grilo-test-ui/main.c +++ b/tools/grilo-test-ui/main.c @@ -565,6 +565,8 @@ clear_query_combo (void) static void clear_ui (void) { + if (!view) + return; clear_panes (); clear_search_combo (); clear_query_combo (); -- cgit v1.2.1