Skip to content

Commit

Permalink
Potential fix for a crash we're seeing on Android that should in theo…
Browse files Browse the repository at this point in the history
…ry never happen.
  • Loading branch information
slouken committed Jun 7, 2019
1 parent 20ec866 commit 9261e47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/joystick/SDL_joystick.c
Expand Up @@ -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);
Expand Down

0 comments on commit 9261e47

Please sign in to comment.