Merge pull request #15994 from brainsick/path2d-curve-defense

defend Path2D against a null curve
This commit is contained in:
Rémi Verschelde 2018-01-23 07:47:34 +01:00 committed by GitHub
commit 19548753f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));