[grilo/wip/hadess/test-ui-startup-crash] grilo-test-ui: Fix crash if app couldn't get on the bus




commit 3d30f160d33ca7dd1f3e2ebf731585297f3f5ea6
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Aug 26 12:38:57 2020 +0200

    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 ();


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