Fix nullptr-dereferencing

- Fix a possible nullptr-exception.
pull/4328/head
Kim Kulling 2022-01-06 22:35:32 +01:00 committed by GitHub
parent 6a1f720f68
commit 776130534b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -264,6 +264,9 @@ void X3DImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
//search for root node element //search for root node element
mNodeElementCur = NodeElement_List.front(); mNodeElementCur = NodeElement_List.front();
if (mNodeElementCur == nullptr) {
return;
}
while (mNodeElementCur->Parent != nullptr) { while (mNodeElementCur->Parent != nullptr) {
mNodeElementCur = mNodeElementCur->Parent; mNodeElementCur = mNodeElementCur->Parent;
} }