From 9261e473d668bf3831da4d7a7da301f9aeebfee5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 7 Jun 2019 09:00:24 -0700 Subject: [PATCH] Potential fix for a crash we're seeing on Android that should in theory never happen. --- src/joystick/SDL_joystick.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 430934c33d3f2..a44b643a858a2 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1044,7 +1044,10 @@ SDL_JoystickUpdate(void) for (joystick = SDL_joysticks; joystick; joystick = joystick->next) { if (joystick->attached) { - joystick->driver->Update(joystick); + /* This should always be true, but seeing a crash in the wild...? */ + if (joystick->driver) { + joystick->driver->Update(joystick); + } if (joystick->delayed_guide_button) { SDL_GameControllerHandleDelayedGuideButton(joystick);