summaryrefslogtreecommitdiff
path: root/scene/3d/mesh_instance_3d.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-01 11:29:19 +0200
committerGitHub <noreply@github.com>2021-10-01 11:29:19 +0200
commit6ed3e9c182627385bf7e249bf770e845d0b949d8 (patch)
tree02b75f6d38b31649e3cccbe3dcc50cef2beabcd0 /scene/3d/mesh_instance_3d.cpp
parent8be97e3b51f5adbee0f9f5d3193da53680a44695 (diff)
parent82f7f2c46c023629042d16ada5d5085bd29bb9ad (diff)
Merge pull request #53208 from timothyqiu/headless-crash
Diffstat (limited to 'scene/3d/mesh_instance_3d.cpp')
-rw-r--r--scene/3d/mesh_instance_3d.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp
index 4de67dd5dc..67f4a88228 100644
--- a/scene/3d/mesh_instance_3d.cpp
+++ b/scene/3d/mesh_instance_3d.cpp
@@ -369,6 +369,8 @@ void MeshInstance3D::create_debug_tangents() {
for (int i = 0; i < mesh->get_surface_count(); i++) {
Array arrays = mesh->surface_get_arrays(i);
+ ERR_CONTINUE(arrays.size() != Mesh::ARRAY_MAX);
+
Vector<Vector3> verts = arrays[Mesh::ARRAY_VERTEX];
Vector<Vector3> norms = arrays[Mesh::ARRAY_NORMAL];
if (norms.size() == 0) {