Fix crash related to structure rigs not having meta level, and a traceback that might happen occasionally.
This commit is contained in:
@@ -41,6 +41,7 @@ class MetaSwap(ContextMenu):
|
||||
self.moduleLookup = {}
|
||||
|
||||
def get_metalevel(x):
|
||||
if "metaLevel" not in x.attributes: return 0
|
||||
return x.attributes["metaLevel"].value
|
||||
|
||||
def get_metagroup(x):
|
||||
|
||||
@@ -231,8 +231,11 @@ class PFNotebook(wx.Panel):
|
||||
idx = self.GetPageIndex(page)
|
||||
|
||||
if toggle and page == self.activePage:
|
||||
# Set page to the first non-disabled page
|
||||
self.SetSelection(next(i for i, _ in enumerate(self.pages) if not self.tabsContainer.tabs[i].disabled))
|
||||
try:
|
||||
# Set page to the first non-disabled page
|
||||
self.SetSelection(next(i for i, _ in enumerate(self.pages) if not self.tabsContainer.tabs[i].disabled))
|
||||
except StopIteration, ex:
|
||||
self.SetSelection(0)
|
||||
|
||||
self.tabsContainer.DisableTab(idx, toggle)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user