SDL: Check for _mSDLOpenJoystick null return
This commit is contained in:
parent
40cae51e28
commit
86453b8107
@ -396,6 +396,10 @@ void mSDLUpdateJoysticks(struct mSDLEvents* events, const struct Configuration*
|
|||||||
events->players[i]->joystick = NULL;
|
events->players[i]->joystick = NULL;
|
||||||
}
|
}
|
||||||
struct SDL_JoystickCombo* joystick = _mSDLOpenJoystick(events, event.jdevice.which);
|
struct SDL_JoystickCombo* joystick = _mSDLOpenJoystick(events, event.jdevice.which);
|
||||||
|
if (!joystick) {
|
||||||
|
mLOG(SDL_EVENTS, ERROR, "SDL joystick hotplug attach failed: %s", SDL_GetError());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < events->playersAttached && i < MAX_PLAYERS; ++i) {
|
for (i = 0; i < events->playersAttached && i < MAX_PLAYERS; ++i) {
|
||||||
if (joysticks[i] != -1) {
|
if (joysticks[i] != -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user