1
0
Fork 0

Do not crash if event has no graphics context assigned

This commit is contained in:
Thomas Geymayer 2013-05-16 23:06:30 +02:00
parent 351f1f4565
commit 6a3354cb15

View 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)