mirror of https://github.com/mgba-emu/mgba.git
SDL: Check for _mSDLOpenJoystick null return
This commit is contained in:
parent
40cae51e28
commit
86453b8107
src/platform/sdl
|
@ -396,6 +396,10 @@ void mSDLUpdateJoysticks(struct mSDLEvents* events, const struct Configuration*
|
|||
events->players[i]->joystick = NULL;
|
||||
}
|
||||
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) {
|
||||
if (joysticks[i] != -1) {
|
||||
|
|
Loading…
Reference in New Issue