From c4a2ee484059bd718829ec7d3cb381348ef32ac0 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 20 Jul 2012 05:09:46 -0400 Subject: [PATCH] handle unset browser in open_selection --- termite.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/termite.c b/termite.c index ad4f7eb..1b21e28 100644 --- a/termite.c +++ b/termite.c @@ -194,10 +194,14 @@ static void move_to_row_start(VteTerminal *vte, select_info *select, long row) { } static void open_selection(VteTerminal *vte) { - AtkText *text = ATK_TEXT(vte_terminal_accessible_new(vte)); - char *selection = atk_text_get_selection(text, 0, NULL, NULL); - launch_browser(selection); - g_free(selection); + if (browser_cmd[0]) { + AtkText *text = ATK_TEXT(vte_terminal_accessible_new(vte)); + char *selection = atk_text_get_selection(text, 0, NULL, NULL); + launch_browser(selection); + g_free(selection); + } else { + g_printerr("no browser to open url"); + } } /* {{{ CALLBACKS */