Update glTF2Asset.inl

Fix possible nullptr-dereferencing.
pull/2243/head
Kim Kulling 2018-11-27 20:18:00 +01:00 committed by GitHub
parent d44e25350f
commit 657014dff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1359,9 +1359,11 @@ inline void Asset::Load(const std::string& pFile, bool isBinary)
// Force reading of skins since they're not always directly referenced // Force reading of skins since they're not always directly referenced
if (Value* skinsArray = FindArray(doc, "skins")) { if (Value* skinsArray = FindArray(doc, "skins")) {
for (unsigned int i = 0; i < skinsArray->Size(); ++i) { if ( nullptr != skinsArray ) {
skins.Retrieve(i); for (unsigned int i = 0; i < skinsArray->Size(); ++i) {
} skins.Retrieve(i);
}
}
} }
if (Value* animsArray = FindArray(doc, "animations")) { if (Value* animsArray = FindArray(doc, "animations")) {