# 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-9d2fd5bffc1fpull/1/head
parent
9e9f8dfb27
commit
1fcb1a1d8e
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue