From 2bcbc6fb3ac772209ffa70c75e00d6d13688520f Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Mon, 12 Jan 2026 16:12:13 +0100 Subject: [PATCH] Draft: fix constrain error if there is no new point (#26868) * Add None check before constraining new_point * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Mod/Draft/DraftGui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index 6546146f79..c531372ee9 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -1719,7 +1719,10 @@ class DraftToolBar: self.mask = val if hasattr(FreeCADGui, "Snapper"): FreeCADGui.Snapper.mask = val - self.new_point = FreeCADGui.Snapper.constrain(self.new_point, self.get_last_point()) + if self.new_point is not None: + self.new_point = FreeCADGui.Snapper.constrain( + self.new_point, self.get_last_point() + ) def changeXValue(self, d): if self.display_point_active: