commit | fdfa4783eb2d1fdf40f071150baa4182c53609ce | [log] [tgz] |
---|---|---|
author | David Ludwig <dludwig@pobox.com> | Wed Feb 05 13:16:17 2020 -0500 |
committer | David Ludwig <dludwig@pobox.com> | Wed Feb 05 13:16:17 2020 -0500 |
tree | a022cb8170e51ae5c73ed646175b6a43c5f5637f | |
parent | a8c1a2188742ebb4e4b66d965dc36631f854b6a4 [diff] |
macOS: fix crash if and when joystick-init-on-add fails
diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c index 3900440..461a85f 100644 --- a/src/joystick/darwin/SDL_sysjoystick.c +++ b/src/joystick/darwin/SDL_sysjoystick.c
@@ -137,7 +137,7 @@ if ( gpDeviceList == removeDevice ) { gpDeviceList = pDeviceNext; - } else { + } else if (gpDeviceList) { recDevice *device = gpDeviceList; while (device->pNext != removeDevice) { device = device->pNext;