Don't segfault when moving to/off the invalid spot [2].

This commit is contained in:
Murilo Pereira 2011-06-03 00:10:48 -03:00
parent 9fbd1cbcaf
commit 548fe23b5d

View File

@ -155,7 +155,8 @@ void handle_keyboard_event(int key) {
handle_stock_event(); handle_stock_event();
} else { } else {
struct card *card; 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); expose_card(card);
draw_card(card); draw_card(card);
} else { } else {