From c4d0f528b14cd022d2a360cee8f90c1c572b2ac4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 28 Apr 2018 08:53:27 -0300 Subject: Do not crash if the polygon is invalid --- modules/csg/csg_shape.cpp | 3 +++ 1 file changed, 3 insertions(+) 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 CSGShape::get_brush_faces() { ERR_FAIL_COND_V(!is_inside_tree(), PoolVector()); CSGBrush *b = _get_brush(); + if (!b) { + return PoolVector(); + } PoolVector faces; int fc = b->faces.size(); -- cgit v1.2.3