Added handling of dynamic_cast<> returning NULL

This commit is contained in:
Robert Osfield
2016-06-24 11:31:15 +01:00
parent 18fc7c28b0
commit ef93e42136

View File

@@ -53,6 +53,9 @@ bool PickEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
{
if (ea.getHandled()) return false;
osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa);
if (!viewer) return false;
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::MOVE):
@@ -64,7 +67,6 @@ bool PickEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
{
_drawablesOnPush.clear();
}
osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa);
osgUtil::LineSegmentIntersector::Intersections intersections;
if (viewer->computeIntersections(ea, nv->getNodePath(), intersections))
{