Procházet zdrojové kódy

X: Throw error when scene contains no root node

Otherwise MakeLeftHandedProcess will crash.
Turo Lamminen před 10 roky
rodič
revize
4c28f31f43
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      code/XFileImporter.cpp

+ 4 - 0
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);