From 650f7a52a7796c485082eba7d21585daf46efb57 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Sun, 9 Jun 2024 01:54:02 -0300 Subject: [PATCH] Check if snake minigame is active before mapping joystick events --- src/snake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++;