Fixed null pointer check
This commit is contained in:
parent
84eca67498
commit
b907a6e1a6
@ -161,9 +161,8 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline osg::Array* makeVertexBuffer(const osg::Array* array, bool copyUserData=true) {
|
inline osg::Array* makeVertexBuffer(const osg::Array* array, bool copyUserData=true) {
|
||||||
osg::Array* buffer = 0;
|
osg::Array* buffer = array ? osg::cloneType(array) : 0;
|
||||||
if(array) {
|
if(buffer) {
|
||||||
buffer = dynamic_cast<osg::Array*>(array->cloneType());
|
|
||||||
buffer->setBinding(osg::Array::BIND_PER_VERTEX);
|
buffer->setBinding(osg::Array::BIND_PER_VERTEX);
|
||||||
if(copyUserData && array->getUserDataContainer()) {
|
if(copyUserData && array->getUserDataContainer()) {
|
||||||
buffer->setUserDataContainer(osg::clone(array->getUserDataContainer(), osg::CopyOp::DEEP_COPY_ALL));
|
buffer->setUserDataContainer(osg::clone(array->getUserDataContainer(), osg::CopyOp::DEEP_COPY_ALL));
|
||||||
|
Loading…
Reference in New Issue
Block a user