mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Handle mesh load failure without crashing
This commit is contained in:
parent
f213376b35
commit
cff35cf0b3
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue