Skip to content

Commit

Permalink
Handle mesh load failure without crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 12, 2021
1 parent f213376 commit cff35cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/client.cpp
Expand Up @@ -1921,6 +1921,8 @@ scene::IAnimatedMesh* Client::getMesh(const std::string &filename, bool cache)

scene::IAnimatedMesh *mesh = RenderingEngine::get_scene_manager()->getMesh(rfile);
rfile->drop();
if (!mesh)
return nullptr;
mesh->grab();
if (!cache)
RenderingEngine::get_mesh_cache()->removeMesh(mesh);
Expand Down

0 comments on commit cff35cf

Please sign in to comment.