From e41e185eabbaf3a9ab5501228907247b71785b88 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Thu, 25 Aug 2016 22:31:33 +0200 Subject: [PATCH] Android: Fixed crash if closing removed joystick (thanks, Sylvain!). Fixes fix for Bugzilla #3408. --- src/joystick/android/SDL_sysjoystick.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c index 89b816399..4225099c8 100644 --- a/src/joystick/android/SDL_sysjoystick.c +++ b/src/joystick/android/SDL_sysjoystick.c @@ -539,7 +539,9 @@ void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { SDL_joylist_item *item = (SDL_joylist_item *) joystick->hwdata; - item->joystick = NULL; + if (item) { + item->joystick = NULL; + } } /* Function to perform any system-specific joystick related cleanup */