summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-11-01 09:50:34 +0100
committerGitHub <noreply@github.com>2018-11-01 09:50:34 +0100
commit06ecdc1eba8bcb434b5cd5bb51b268ae34399891 (patch)
tree6861880a2e716411816856783fc56431bb7af58f
parent26a0567c43603c4dfb372be858038769906edc4b (diff)
parentf2f81d9703aceddb8a25db9e392fee0acf2f289a (diff)
Merge pull request #23401 from lupoDharkael/null-curve
Fix crash adding point to a Curve2D from the editor
-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);