summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-18 14:58:20 +0100
committerGitHub <noreply@github.com>2021-02-18 14:58:20 +0100
commitef63b29da7adbfa6c4e6d7d99ebceb9ef3f35e70 (patch)
treecdb4b166d183a55448877cd3928c6d5e10ae6ddb
parent5529fe5680aa5c803cc48f1fd11c6e3912d2ac0f (diff)
parent6b602d35f33074add55ec444ff325b3281b9574e (diff)
Merge pull request #46166 from angad-k/fix-mesh-instance3d-crash
add null check in MeshInstance::_mesh_changed()
-rw-r--r--scene/3d/mesh_instance_3d.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp
index 7b3a0820f1..b997c64b29 100644
--- a/scene/3d/mesh_instance_3d.cpp
+++ b/scene/3d/mesh_instance_3d.cpp
@@ -319,6 +319,7 @@ Ref<Material> MeshInstance3D::get_active_material(int p_surface) const {
}
void MeshInstance3D::_mesh_changed() {
+ ERR_FAIL_COND(mesh.is_null());
materials.resize(mesh->get_surface_count());
}