From 548fe23b5dbee722a02f44835767945a00e0a27e Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Fri, 3 Jun 2011 00:10:48 -0300 Subject: [PATCH] Don't segfault when moving to/off the invalid spot [2]. --- src/keyboard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keyboard.c b/src/keyboard.c index 91c9e51..970cc58 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -155,7 +155,8 @@ void handle_keyboard_event(int key) { handle_stock_event(); } else { struct card *card; - if ((card = (*cursor_stack(cursor))->card)->face == COVERED) { + if (cursor_stack(cursor) && + (card = (*cursor_stack(cursor))->card)->face == COVERED) { expose_card(card); draw_card(card); } else {