summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngad Kambli <angadkambli@gmail.com>2021-02-18 16:51:39 +0530
committerAngad Kambli <angadkambli@gmail.com>2021-02-18 16:51:39 +0530
commit6b602d35f33074add55ec444ff325b3281b9574e (patch)
tree176c92c3b7a2b230773f728feb9f751a97f264db
parentbdf3c578ff1d382ccf0c6bd2cde1abf5393fda53 (diff)
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());
}