fix FreeCad crash when no tool is assigned to an operation

This commit is contained in:
Shai Seger
2018-05-07 18:54:19 +03:00
committed by Yorik van Havre
parent ec072982f7
commit b2e9348892
2 changed files with 28 additions and 17 deletions

View File

@@ -480,22 +480,30 @@ class PathSimulation:
self.cutTool.ViewObject.hide()
self.iprogress = 0
self.EndSimulation()
def InvalidOperation(self):
if len(self.activeOps) == 0:
return True
if (self.tool == None):
TSError("No tool assigned for the operation")
return True
return false
def SimFF(self):
if len(self.activeOps) == 0:
if self.InvalidOperation():
return
self.GuiBusy(True)
self.timer.start(1)
self.disableAnim = True
def SimStep(self):
if len(self.activeOps) == 0:
if self.InvalidOperation():
return
self.disableAnim = False
self.PerformCut()
def SimPlay(self):
if len(self.activeOps) == 0:
if self.InvalidOperation():
return
self.disableAnim = False
self.GuiBusy(True)