# OptimizeGraph: fix crash if there is no data remaining after flattening the graph and removing everything that serves no purpose.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@958 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2011-04-22 15:54:08 +00:00
parent 9e9f8dfb27
commit 1fcb1a1d8e
1 changed files with 5 additions and 0 deletions

View File

@ -303,6 +303,11 @@ void OptimizeGraphProcess::Execute( aiScene* pScene)
ai_assert(nodes.size() == 1);
if (dummy_root->mNumChildren == 0) {
pScene->mRootNode = NULL;
throw DeadlyImportError("After optimizing the scene graph, no data remains");
}
if (dummy_root->mNumChildren > 1) {
pScene->mRootNode = dummy_root;