From: James Turner Date: Tue, 22 Mar 2016 10:42:08 +0000 (+0000) Subject: Guard against a crash. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d0c341fa479b8c0bf5cde440d18d56c4b5eb5e1d;p=flightgear.git Guard against a crash. --- diff --git a/src/Viewer/fg_os_osgviewer.cxx b/src/Viewer/fg_os_osgviewer.cxx index 498735fed..0799ffe4a 100644 --- a/src/Viewer/fg_os_osgviewer.cxx +++ b/src/Viewer/fg_os_osgviewer.cxx @@ -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)