diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-09-29 16:59:46 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-09-29 17:24:53 +0800 |
commit | 82f7f2c46c023629042d16ada5d5085bd29bb9ad (patch) | |
tree | 70a650b015c6425b200e8ab5bfa24836f465abb9 /scene/3d | |
parent | ad635567b1964c3e573dedd158cf9dab09364fec (diff) |
Fix crash in headless mode
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/mesh_instance_3d.cpp | 2 |
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) { |