Do not crash if event has no graphics context assigned
This commit is contained in:
parent
351f1f4565
commit
6a3354cb15
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue