Browse Source

Address Android editor crashes

- Add workaround for crash when resuming existing project
Fredia Huya-Kouadio 2 years ago
parent
commit
e8d80fc747
1 changed files with 1 additions and 0 deletions
  1. 1 0
      scene/resources/mesh.cpp

+ 1 - 0
scene/resources/mesh.cpp

@@ -189,6 +189,7 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const {
 			if (primitive == PRIMITIVE_TRIANGLES) {
 				for (int j = 0; j < ic; j++) {
 					int index = ir[j];
+					ERR_FAIL_COND_V(index >= vc, Ref<TriangleMesh>());
 					facesw[widx++] = vr[index];
 				}
 			} else { // PRIMITIVE_TRIANGLE_STRIP