From 3d2f0a07dbbf97dd9273560d12eef84786778c7a Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 3 Mar 2016 08:11:48 +0100 Subject: [PATCH] Quit when failing to create dialog. --- source/rofi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/rofi.c b/source/rofi.c index cc529527..3d9d53d8 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -179,7 +179,11 @@ static void __run_switcher_internal ( ModeMode mode, char *input ) char *prompt = g_strdup_printf ( "%s:", mode_get_name ( modi[mode] ) ); curr_switcher = mode; RofiViewState * state = rofi_view_create ( modi[mode], input, prompt, NULL, MENU_NORMAL, process_result ); - rofi_view_set_active ( state ); + if ( state ) { + rofi_view_set_active ( state ); + } else { + g_main_loop_quit( main_loop ); + } g_free ( prompt ); } static void run_switcher ( ModeMode mode )