From 487c9dc4d38bb36109555e09449473596ae063e4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 19 Dec 2013 22:55:11 +0000 Subject: Avoid segfault on backspace --- src/mainwindow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.c') 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 : -- cgit v1.2.3