macOS: fix crash if and when joystick-init-on-add fails
authorDavid Ludwig <dludwig@pobox.com>
Wed, 05 Feb 2020 13:16:17 -0500
changeset 13489cec913fbe656
parent 13488 97d9e8bfd582
child 13490 1d8cb0c5236b
macOS: fix crash if and when joystick-init-on-add fails
src/joystick/darwin/SDL_sysjoystick.c
     1.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Wed Feb 05 09:29:46 2020 -0800
     1.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Wed Feb 05 13:16:17 2020 -0500
     1.3 @@ -137,7 +137,7 @@
     1.4  
     1.5          if ( gpDeviceList == removeDevice ) {
     1.6              gpDeviceList = pDeviceNext;
     1.7 -        } else {
     1.8 +        } else if (gpDeviceList) {
     1.9              recDevice *device = gpDeviceList;
    1.10              while (device->pNext != removeDevice) {
    1.11                  device = device->pNext;