Fixed an error when a script is closed with no open 3D views.

This commit is contained in:
Jeremy Wright 2014-12-18 14:03:57 -05:00
parent b7f9c7a143
commit 5536bd1d69

View File

@ -70,7 +70,12 @@ class CadQueryCloseScript:
#Close the matching 3D view if it's open
if cqCodePane.file.path is not None:
docname = os.path.splitext(os.path.basename(cqCodePane.file.path))[0]
FreeCAD.closeDocument(docname)
try:
FreeCAD.closeDocument(docname)
except:
#Assume that the document has already been closed
pass
#Clear our script and whatever was rendered by it out
cqCodePane.file.close()