浏览代码

Merge pull request #23401 from lupoDharkael/null-curve

Fix crash adding point to a Curve2D from the editor
Rémi Verschelde 6 年之前
父节点
当前提交
06ecdc1eba
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      scene/2d/path_2d.cpp

+ 4 - 0
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);