aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-12-19 22:55:11 +0000
committerThomas White <taw@bitwiz.org.uk>2013-12-19 22:55:11 +0000
commit487c9dc4d38bb36109555e09449473596ae063e4 (patch)
tree0b05831fe135065b25c1dfa6eddd486582b7174c
parentdd96572950db971746a46964e381b02c1aa25114 (diff)
Avoid segfault on backspace
-rw-r--r--src/mainwindow.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index fcd49a1..7704a14 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1104,6 +1104,8 @@ static void do_backspace(struct frame *fr, struct presentation *p)
{
size_t tlen, olen;
+ if ( fr == NULL ) return;
+
/* If this is, say, the top level frame, do nothing */
if ( fr->sc == NULL ) return;
@@ -1658,8 +1660,10 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event,
break;
case GDK_KEY_BackSpace :
- do_backspace(p->selection[0], p);
- claim = 1;
+ if ( p->n_selection == 1 ) {
+ do_backspace(p->selection[0], p);
+ claim = 1;
+ }
break;
case GDK_KEY_B :