Prevent potential NULL pointer access.
This commit is contained in:
parent
d070474445
commit
474012c442
@ -431,10 +431,10 @@ void OptionsScreenInput2::gotSensedInput(const Input& sensed_input)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GamePadDevice *gpad = input_manager->getDeviceManager()
|
||||||
|
->getGamePadFromIrrID(sensed_input.m_device_id);
|
||||||
|
|
||||||
std::string gamepad_name = input_manager->getDeviceManager()
|
std::string gamepad_name = gpad ? gpad->getName() : "UNKNOWN DEVICE";
|
||||||
->getGamePadFromIrrID(sensed_input.m_device_id)
|
|
||||||
->getName();
|
|
||||||
if (m_config->getName() == gamepad_name)
|
if (m_config->getName() == gamepad_name)
|
||||||
{
|
{
|
||||||
GamepadConfig* config = (GamepadConfig*)m_config;
|
GamepadConfig* config = (GamepadConfig*)m_config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user