From 4c28f31f43ad18586d78652fa96d782e1e509794 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Wed, 1 Apr 2015 16:11:53 +0300 Subject: [PATCH] X: Throw error when scene contains no root node Otherwise MakeLeftHandedProcess will crash. --- code/XFileImporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/XFileImporter.cpp b/code/XFileImporter.cpp index 6f16d7451..75932a17a 100644 --- a/code/XFileImporter.cpp +++ b/code/XFileImporter.cpp @@ -156,6 +156,10 @@ void XFileImporter::CreateDataRepresentationFromImport( aiScene* pScene, XFile:: CreateMeshes( pScene, pScene->mRootNode, pData->mGlobalMeshes); } + if (!pScene->mRootNode) { + throw DeadlyImportError( "No root node" ); + } + // Convert everything to OpenGL space... it's the same operation as the conversion back, so we can reuse the step directly MakeLeftHandedProcess convertProcess; convertProcess.Execute( pScene);