diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index f6dd75a07..c3696ad95 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -204,6 +204,8 @@ func serialize() -> Dictionary: for guide in guides: if guide is SymmetryGuide: continue + if !is_instance_valid(guide): + continue var coords = guide.points[0].x if guide.type == Guide.Types.HORIZONTAL: coords = guide.points[0].y diff --git a/src/UI/Rulers/Guide.gd b/src/UI/Rulers/Guide.gd index e2f57d49d..1d0794a6b 100644 --- a/src/UI/Rulers/Guide.gd +++ b/src/UI/Rulers/Guide.gd @@ -63,10 +63,12 @@ func _draw() -> void: func outside_canvas() -> bool: if type == Types.HORIZONTAL: if points[0].y < 0 || points[0].y > project.size.y: + project.guides.erase(self) queue_free() return true else: if points[0].x < 0 || points[0].x > project.size.x: + project.guides.erase(self) queue_free() return true return false