Don't try deleting tool tables when none exist.

This commit is contained in:
Daniel Wood
2019-09-09 20:26:55 +01:00
parent 2b46157bc6
commit aafd630a9c

View File

@@ -200,9 +200,10 @@ class ToolLibraryManager():
def deleteToolTable(self):
''' deletes the selected tool table '''
index = next((index for (index, d) in enumerate(self.toolTables) if d.Name == self.currentTableName), None)
self.toolTables.pop(index)
self.saveMainLibrary()
if len(self.toolTables):
index = next((index for (index, d) in enumerate(self.toolTables) if d.Name == self.currentTableName), None)
self.toolTables.pop(index)
self.saveMainLibrary()
def renameToolTable(self, newName, index):
''' renames a tool table with the new name'''