diff --git a/src/platform/sdl/sdl-events.c b/src/platform/sdl/sdl-events.c index ca8345d22..df5218407 100644 --- a/src/platform/sdl/sdl-events.c +++ b/src/platform/sdl/sdl-events.c @@ -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) {