Skip to content
Permalink
Browse files

Handle mesh load failure without crashing

  • Loading branch information
sfan5 committed Mar 12, 2021
1 parent f213376 commit cff35cf0b328635b2c77c024343f8e7f2d016990
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/client/client.cpp
@@ -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);

0 comments on commit cff35cf

Please sign in to comment.