diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-04-28 08:53:27 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-04-28 08:53:27 -0300 |
commit | c4d0f528b14cd022d2a360cee8f90c1c572b2ac4 (patch) | |
tree | a875ec3a4b5bf5497bb01120faff453a7fe9d58a /modules/csg | |
parent | afb4ce8d2d637b0a2cb56c0450c6b3c5d10aa47f (diff) |
Do not crash if the polygon is invalid
Diffstat (limited to 'modules/csg')
-rw-r--r-- | modules/csg/csg_shape.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 4da94c3baa..a8d0a1fb94 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -226,6 +226,9 @@ AABB CSGShape::get_aabb() const { PoolVector<Vector3> CSGShape::get_brush_faces() { ERR_FAIL_COND_V(!is_inside_tree(), PoolVector<Vector3>()); CSGBrush *b = _get_brush(); + if (!b) { + return PoolVector<Vector3>(); + } PoolVector<Vector3> faces; int fc = b->faces.size(); |