1
0
Fork 0

Fix a crash with clicks on reset

This commit is contained in:
James Turner 2020-08-11 14:03:55 +01:00
parent fff2fa1718
commit b4df97beb6

View file

@ -134,7 +134,9 @@ public:
case(osgGA::GUIEventAdapter::PUSH):
case(osgGA::GUIEventAdapter::RELEASE):
{
FGMouseInput* mouseSubsystem = globals->get_subsystem<FGInput>()->get_subsystem<FGMouseInput>();
// during splash/reset, either of these can return nullptr
const auto input = globals->get_subsystem<FGInput>();
const auto mouseSubsystem = input ? input->get_subsystem<FGMouseInput>() : nullptr;
if (mouseSubsystem && !mouseSubsystem->isActiveModePassThrough()) {
return false;
}