]> git.mxchange.org Git - flightgear.git/commitdiff
Guard against a crash.
authorJames Turner <zakalawe@mac.com>
Tue, 22 Mar 2016 10:42:08 +0000 (10:42 +0000)
committerJames Turner <zakalawe@mac.com>
Tue, 22 Mar 2016 10:42:21 +0000 (10:42 +0000)
src/Viewer/fg_os_osgviewer.cxx

index 498735fedc90bfdd85e55df1981dfedfdac60a29..0799ffe4af1cd01315077bf66b7b5882f5360f89 100644 (file)
@@ -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)