diff options
author | sfan5 <sfan5@live.de> | 2021-03-12 19:30:56 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-03-12 20:56:02 +0100 |
commit | cff35cf0b328635b2c77c024343f8e7f2d016990 (patch) | |
tree | a347f326ca6fa00b75f8a23f1be5ea08b7b49134 /src/client | |
parent | f213376b35795982edbdeb2caeb7ca9495b3848e (diff) | |
download | minetest-cff35cf0b328635b2c77c024343f8e7f2d016990.tar.gz minetest-cff35cf0b328635b2c77c024343f8e7f2d016990.tar.bz2 minetest-cff35cf0b328635b2c77c024343f8e7f2d016990.zip |
Handle mesh load failure without crashing
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index ef4a3cdfc..746c6c080 100644 --- a/src/client/client.cpp +++ b/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); |