Update glTF2Asset.inl

Fix possible nullptr-dereferencing.
This commit is contained in:
Kim Kulling
2018-11-27 20:18:00 +01:00
committed by GitHub
parent d44e25350f
commit 657014dff6

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
if (Value* skinsArray = FindArray(doc, "skins")) {
for (unsigned int i = 0; i < skinsArray->Size(); ++i) {
skins.Retrieve(i);
}
if ( nullptr != skinsArray ) {
for (unsigned int i = 0; i < skinsArray->Size(); ++i) {
skins.Retrieve(i);
}
}
}
if (Value* animsArray = FindArray(doc, "animations")) {