Guard against a crash.
This commit is contained in:
parent
209194ecba
commit
d0c341fa47
1 changed files with 3 additions and 2 deletions
|
@ -341,11 +341,12 @@ int fgOSMainLoop()
|
|||
|
||||
int fgGetKeyModifiers()
|
||||
{
|
||||
if (!globals->get_renderer()) { // happens during shutdown
|
||||
FGRenderer* r = globals->get_renderer();
|
||||
if (!r || !r->getEventHandler()) { // happens during shutdown
|
||||
return 0;
|
||||
}
|
||||
|
||||
return globals->get_renderer()->getEventHandler()->getCurrentModifiers();
|
||||
return r->getEventHandler()->getCurrentModifiers();
|
||||
}
|
||||
|
||||
void fgWarpMouse(int x, int y)
|
||||
|
|
Loading…
Reference in a new issue