Merge pull request #2502 from arkeon7/Ogre_with_skeleton_missing

Prevent crash when Ogre skeleton file is missing
pull/2501/head^2
Kim Kulling 2019-06-09 01:21:35 +02:00 committed by GitHub
commit 56d145e26a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -864,6 +864,8 @@ bool OgreBinarySerializer::ImportSkeleton(Assimp::IOSystem *pIOHandler, Mesh *me
} }
MemoryStreamReaderPtr reader = OpenReader(pIOHandler, mesh->skeletonRef); MemoryStreamReaderPtr reader = OpenReader(pIOHandler, mesh->skeletonRef);
if (!reader)
return false;
Skeleton *skeleton = new Skeleton(); Skeleton *skeleton = new Skeleton();
OgreBinarySerializer serializer(reader.get(), OgreBinarySerializer::AM_Skeleton); OgreBinarySerializer serializer(reader.get(), OgreBinarySerializer::AM_Skeleton);