X: Throw error when scene contains no root node

Otherwise MakeLeftHandedProcess will crash.
pull/523/head
Turo Lamminen 2015-04-01 16:11:53 +03:00
parent 8cdf9467c5
commit 4c28f31f43
1 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,10 @@ void XFileImporter::CreateDataRepresentationFromImport( aiScene* pScene, XFile::
CreateMeshes( pScene, pScene->mRootNode, pData->mGlobalMeshes); 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 // Convert everything to OpenGL space... it's the same operation as the conversion back, so we can reuse the step directly
MakeLeftHandedProcess convertProcess; MakeLeftHandedProcess convertProcess;
convertProcess.Execute( pScene); convertProcess.Execute( pScene);