Fixed crash when AntiSquish node is the root of the scene graph.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14840 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-04-16 10:07:23 +00:00
parent 4a734b314c
commit c61c3d5500

View File

@@ -98,8 +98,10 @@ bool AntiSquish::computeUnSquishedMatrix(osg::Matrix& unsquished) const
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _cacheLock );
osg::NodePathList nodePaths = getParentalNodePaths();
osg::NodePath np;
if (!nodePaths.empty()) np = nodePaths.front();
if (nodePaths.empty()) return false;
osg::NodePath np = nodePaths.front();
if (np.empty()) return false;
// Remove the last node which is the anti squish node itself.
np.pop_back();