From fd6a98b753a1b749129d0c743db5d02bcedd7b0a Mon Sep 17 00:00:00 2001 From: Todd Ross Date: Mon, 22 Jan 2018 22:39:36 -0600 Subject: [PATCH] defend Path2D against a null curve --- scene/2d/path_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 2c8f509bd3c..052a0ac026b 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -39,7 +39,7 @@ Rect2 Path2D::_edit_get_rect() const { - if (curve->get_point_count() == 0) + if (!curve.is_valid() || curve->get_point_count() == 0) return Rect2(0, 0, 0, 0); Rect2 aabb = Rect2(curve->get_point_position(0), Vector2(0, 0));