summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2021-09-29 16:59:46 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2021-09-29 17:24:53 +0800
commit82f7f2c46c023629042d16ada5d5085bd29bb9ad (patch)
tree70a650b015c6425b200e8ab5bfa24836f465abb9 /scene/3d
parentad635567b1964c3e573dedd158cf9dab09364fec (diff)
Fix crash in headless mode
Diffstat (limited to 'scene/3d')
-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 7e7db57af3..28bf468cb7 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) {