Try to fix #1879: avoid using NULL pointer in case of ignored

devices.
This commit is contained in:
hiker 2015-01-08 08:09:17 +11:00
parent 58f659d43e
commit 8b0a2f303c

View File

@ -555,6 +555,9 @@ void InputManager::dispatchInput(Input::InputType type, int deviceID,
if (type == Input::IT_STICKBUTTON || type == Input::IT_STICKMOTION)
{
GamePadDevice *gPad = m_device_manager->getGamePadFromIrrID(deviceID);
// This can happen in case of automatically ignored accelerator
// devices, which are not part of stk's gamepad mapping.
if (!gPad) return;
DeviceConfig *conf = gPad->getConfiguration();
if (!conf->isEnabled())
return;