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>
(cherry picked from commit 2019ff051e)
This commit is contained in:
Roy-043
2026-01-13 02:51:26 +01:00
committed by Max Wilfinger
parent 37c0c6b328
commit e9ec91adfd
+4 -1
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: