diff --git a/src/snake.c b/src/snake.c index 2349d5fdb..4219d5b8f 100644 --- a/src/snake.c +++ b/src/snake.c @@ -582,7 +582,7 @@ boolean Snake_JoyGrabber(void *opaque, event_t *ev) { snake_t *snake = opaque; - if (ev->type == ev_joystick && ev->key == 0) + if (snake != NULL && ev->type == ev_joystick && ev->key == 0) { snake->joyevents[snake->joyeventcount] = ev; snake->joyeventcount++;