Block accessing non-valid controllers

This commit is contained in:
Maschell 2020-09-05 14:02:30 +02:00
parent dfe2438574
commit 94f5e90638

View File

@ -85,7 +85,7 @@ void ControllerManager::processEvent(SDL_JoystickID joystickId, int32_t channel,
channel = joystickToChannel[joystickId];
}
}
if (channel != -1) {
if (channel != -1 && controllerList.contains(static_cast<const GuiTrigger::eChannels>(channel))) {
controllerList[static_cast<GuiTrigger::eChannels>(channel)]->update(e, screenWidth, screenHeight);
}
}