From 776130534bb66cb64c6f11b92a1375df9604ba83 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 6 Jan 2022 22:35:32 +0100 Subject: [PATCH] Fix nullptr-dereferencing - Fix a possible nullptr-exception. --- code/AssetLib/X3D/X3DImporter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/AssetLib/X3D/X3DImporter.cpp b/code/AssetLib/X3D/X3DImporter.cpp index fb8ec9bc5..f32f485df 100644 --- a/code/AssetLib/X3D/X3DImporter.cpp +++ b/code/AssetLib/X3D/X3DImporter.cpp @@ -264,6 +264,9 @@ void X3DImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy //search for root node element mNodeElementCur = NodeElement_List.front(); + if (mNodeElementCur == nullptr) { + return; + } while (mNodeElementCur->Parent != nullptr) { mNodeElementCur = mNodeElementCur->Parent; }