Check if there is an selection when opening selection
Prevent a segfault when trying to open a selection, when there is no selection.
This commit is contained in:
parent
9eda6c5913
commit
3bc2a43bef
|
@ -564,6 +564,11 @@ static void move_to_row_start(VteTerminal *vte, select_info *select, long row) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void open_selection(char *browser, VteTerminal *vte) {
|
static void open_selection(char *browser, VteTerminal *vte) {
|
||||||
|
if (!vte_terminal_get_has_selection(vte)) {
|
||||||
|
g_printerr("no selection to open\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
auto selection = make_unique(vte_terminal_get_selection(vte), g_free);
|
auto selection = make_unique(vte_terminal_get_selection(vte), g_free);
|
||||||
if (selection && *selection) {
|
if (selection && *selection) {
|
||||||
|
|
Loading…
Reference in New Issue