You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Do not crash if the polygon is invalid
This commit is contained in:
@@ -226,6 +226,9 @@ AABB CSGShape::get_aabb() const {
|
|||||||
PoolVector<Vector3> CSGShape::get_brush_faces() {
|
PoolVector<Vector3> CSGShape::get_brush_faces() {
|
||||||
ERR_FAIL_COND_V(!is_inside_tree(), PoolVector<Vector3>());
|
ERR_FAIL_COND_V(!is_inside_tree(), PoolVector<Vector3>());
|
||||||
CSGBrush *b = _get_brush();
|
CSGBrush *b = _get_brush();
|
||||||
|
if (!b) {
|
||||||
|
return PoolVector<Vector3>();
|
||||||
|
}
|
||||||
|
|
||||||
PoolVector<Vector3> faces;
|
PoolVector<Vector3> faces;
|
||||||
int fc = b->faces.size();
|
int fc = b->faces.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user