1
0
Fork 0

Guard against a crash.

This commit is contained in:
James Turner 2016-03-22 10:42:08 +00:00
parent 209194ecba
commit d0c341fa47

View file

@ -341,11 +341,12 @@ int fgOSMainLoop()
int fgGetKeyModifiers() int fgGetKeyModifiers()
{ {
if (!globals->get_renderer()) { // happens during shutdown FGRenderer* r = globals->get_renderer();
if (!r || !r->getEventHandler()) { // happens during shutdown
return 0; return 0;
} }
return globals->get_renderer()->getEventHandler()->getCurrentModifiers(); return r->getEventHandler()->getCurrentModifiers();
} }
void fgWarpMouse(int x, int y) void fgWarpMouse(int x, int y)