You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 19:11:41 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user