aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-03-12 19:30:56 +0100
committersfan5 <sfan5@live.de>2021-03-12 20:56:02 +0100
commitcff35cf0b328635b2c77c024343f8e7f2d016990 (patch)
treea347f326ca6fa00b75f8a23f1be5ea08b7b49134 /src/client
parentf213376b35795982edbdeb2caeb7ca9495b3848e (diff)
downloadminetest-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.cpp2
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);