diff options
author | Jean-François Michaud <jfmichaud31@gmail.com> | 2018-10-12 19:12:01 -0400 |
---|---|---|
committer | Jean-François Michaud <jfmichaud31@gmail.com> | 2018-10-15 15:26:02 -0400 |
commit | 720f543caa9cdefbc92273a419d17bb6441b027e (patch) | |
tree | 01528d5886e40f4eb48e122013d4657dac7d4579 /modules/csg/csg_shape.cpp | |
parent | 451e5fd0511bc2c17a66fc73a0de9a5169109517 (diff) |
Added a fail condition to prevent a crash
Diffstat (limited to 'modules/csg/csg_shape.cpp')
-rw-r--r-- | modules/csg/csg_shape.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index d1ef08dc83..44044d2750 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -521,6 +521,11 @@ CSGBrush *CSGMesh::_build_brush() { Array arrays = mesh->surface_get_arrays(i); + if (arrays.size() == 0) { + _make_dirty(); + ERR_FAIL_COND_V(arrays.size() == 0, NULL); + } + PoolVector<Vector3> avertices = arrays[Mesh::ARRAY_VERTEX]; if (avertices.size() == 0) continue; |