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));