summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorlupoDharkael <izhe@hotmail.es>2018-10-30 14:44:05 +0100
committerlupoDharkael <izhe@hotmail.es>2018-10-30 14:45:37 +0100
commitf2f81d9703aceddb8a25db9e392fee0acf2f289a (patch)
tree9dc041370cc61358e704d7904a30f0859e72528d /scene
parentbfd1f09ac515706e4c55335cf4be22676adefd6d (diff)
Fix crash adding point to a Curve2D from the editor
Adding point to a Path2D with null Curve2D from the canvas was causing a crash after trying to use a null object.
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/path_2d.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index cdb208e6cd..4276918f53 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -63,6 +63,10 @@ bool Path2D::_edit_use_rect() const {
bool Path2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
+ if (curve.is_null()) {
+ return false;
+ }
+
for (int i = 0; i < curve->get_point_count(); i++) {
Vector2 s[2];
s[0] = curve->get_point_position(i);