Skip to content

Commit

Permalink
Fix to avoid a crash when AssimSceneLoader tries to load an unsupport…
Browse files Browse the repository at this point in the history
…ed mesh file
  • Loading branch information
s-nakaoka committed Aug 3, 2020
1 parent 0072eb4 commit 8f0d936
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/AssimpSceneLoader/AssimpSceneLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ SgNode* AssimpSceneLoaderImpl::load(const std::string& filename)
filename,
aiProcess_Triangulate | aiProcess_JoinIdenticalVertices);

if(!scene){
os() << importer.GetErrorString() << endl;
if(!scene || !scene->mRootNode){
auto error = importer.GetErrorString();
if(error && *error != '\0'){
os() << error << endl;
}
return nullptr;
}

Expand Down

0 comments on commit 8f0d936

Please sign in to comment.