From 20c9500fbe14630e9f9f73f2021ff2f54dd9ab76 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Fri, 8 Jan 2016 22:20:00 +0100 Subject: [PATCH] Add a null check when pressing backspace Closes: #270 --- termite.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/termite.cc b/termite.cc index 55b79e4..5e0cc97 100644 --- a/termite.cc +++ b/termite.cc @@ -948,7 +948,7 @@ gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, keybind_info *i } switch (event->keyval) { case GDK_KEY_BackSpace: - if (info->panel.mode == overlay_mode::urlselect) { + if (info->panel.mode == overlay_mode::urlselect && info->panel.fulltext) { size_t slen = strlen(info->panel.fulltext); if (info->panel.fulltext != nullptr && slen > 0) info->panel.fulltext[slen-1] = '\0';