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>
This commit is contained in:
Roy-043
2026-01-12 16:12:13 +01:00
committed by GitHub
parent 7a99ccf5ff
commit 2bcbc6fb3a

View File

@@ -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: