From e3225a2c4b29ade21a9d637a801ab9bc6f2ef69c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 11 Feb 2011 09:18:36 +0000 Subject: [PATCH] Added check against the NodePath being empty. --- src/osgGA/NodeTrackerManipulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgGA/NodeTrackerManipulator.cpp b/src/osgGA/NodeTrackerManipulator.cpp index ef3d10e9d..077dd7ee6 100644 --- a/src/osgGA/NodeTrackerManipulator.cpp +++ b/src/osgGA/NodeTrackerManipulator.cpp @@ -167,7 +167,7 @@ void NodeTrackerManipulator::computeNodeCenterAndRotation(osg::Vec3d& nodeCenter computeNodeWorldToLocal(worldToLocal); osg::NodePath nodePath; - if (_trackNodePath.getNodePath(nodePath)) + if (_trackNodePath.getNodePath(nodePath) && !nodePath.empty()) nodeCenter = osg::Vec3d(nodePath.back()->getBound().center())*localToWorld; else nodeCenter = osg::Vec3d(0.0f,0.0f,0.0f)*localToWorld;