summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2020-08-26 12:38:57 +0200
committerBastien Nocera <hadess@hadess.net>2020-08-26 12:47:38 +0200
commit3d30f160d33ca7dd1f3e2ebf731585297f3f5ea6 (patch)
tree098e3f9dde5df3e8c11f32aafaee903805cd6ead
parentdc6be701e124ed78b14347bb0c131715d3f011c8 (diff)
downloadgrilo-3d30f160d33ca7dd1f3e2ebf731585297f3f5ea6.tar.gz
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.
-rw-r--r--tools/grilo-test-ui/main.c2
1 files changed, 2 insertions, 0 deletions
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 ();