Potential fix for a crash we're seeing on Android that should in theory never happen.
authorSam Lantinga <slouken@libsdl.org>
Fri, 07 Jun 2019 09:00:24 -0700
changeset 127645bd8243f0a35
parent 12763 e539b6245d43
child 12765 80586f864508
Potential fix for a crash we're seeing on Android that should in theory never happen.
src/joystick/SDL_joystick.c
     1.1 --- a/src/joystick/SDL_joystick.c	Thu Jun 06 08:20:53 2019 -0700
     1.2 +++ b/src/joystick/SDL_joystick.c	Fri Jun 07 09:00:24 2019 -0700
     1.3 @@ -1044,7 +1044,10 @@
     1.4  
     1.5      for (joystick = SDL_joysticks; joystick; joystick = joystick->next) {
     1.6          if (joystick->attached) {
     1.7 -            joystick->driver->Update(joystick);
     1.8 +            /* This should always be true, but seeing a crash in the wild...? */
     1.9 +            if (joystick->driver) {
    1.10 +                joystick->driver->Update(joystick);
    1.11 +            }
    1.12  
    1.13              if (joystick->delayed_guide_button) {
    1.14                  SDL_GameControllerHandleDelayedGuideButton(joystick);