From b907a6e1a6eeb49d0e10bc9109b70e4337fbf8b5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 6 Jul 2016 20:13:36 +0100 Subject: [PATCH] Fixed null pointer check --- src/osgPlugins/gles/SubGeometry | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/gles/SubGeometry b/src/osgPlugins/gles/SubGeometry index 41b1d0129..b189f3eb4 100644 --- a/src/osgPlugins/gles/SubGeometry +++ b/src/osgPlugins/gles/SubGeometry @@ -161,9 +161,8 @@ protected: } inline osg::Array* makeVertexBuffer(const osg::Array* array, bool copyUserData=true) { - osg::Array* buffer = 0; - if(array) { - buffer = dynamic_cast(array->cloneType()); + osg::Array* buffer = array ? osg::cloneType(array) : 0; + if(buffer) { buffer->setBinding(osg::Array::BIND_PER_VERTEX); if(copyUserData && array->getUserDataContainer()) { buffer->setUserDataContainer(osg::clone(array->getUserDataContainer(), osg::CopyOp::DEEP_COPY_ALL));