From 5679dd435ab06925595f7b1d7e09308853a0bf0f Mon Sep 17 00:00:00 2001 From: Arkeon Date: Fri, 7 Jun 2019 09:49:24 +0200 Subject: [PATCH] Prevent crash when Ogre skeleton file is missing --- code/OgreBinarySerializer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/OgreBinarySerializer.cpp b/code/OgreBinarySerializer.cpp index b2326e244..589e69c7e 100644 --- a/code/OgreBinarySerializer.cpp +++ b/code/OgreBinarySerializer.cpp @@ -864,6 +864,8 @@ bool OgreBinarySerializer::ImportSkeleton(Assimp::IOSystem *pIOHandler, Mesh *me } MemoryStreamReaderPtr reader = OpenReader(pIOHandler, mesh->skeletonRef); + if (!reader) + return false; Skeleton *skeleton = new Skeleton(); OgreBinarySerializer serializer(reader.get(), OgreBinarySerializer::AM_Skeleton);