]> git.mxchange.org Git - flightgear.git/commitdiff
Do not crash if event has no graphics context assigned
authorThomas Geymayer <tomgey@gmail.com>
Thu, 16 May 2013 21:06:30 +0000 (23:06 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Thu, 16 May 2013 21:06:52 +0000 (23:06 +0200)
src/Viewer/FGEventHandler.cxx

index aa3d5ac494758e06312944afe852f74e36e17bd7..c0978b1648807ce7dc6e4a27e765925569613095 100644 (file)
@@ -151,6 +151,8 @@ eventToViewport(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us,
     y = -1;
 
     const osg::GraphicsContext* eventGC = ea.getGraphicsContext();
+    if( !eventGC )
+      return false; // TODO how can this happen?
     const osg::GraphicsContext::Traits* traits = eventGC->getTraits();
     osg::Camera* guiCamera = getGUICamera(CameraGroup::getDefault());
     if (!guiCamera)