Skip to content

Commit

Permalink
wxPython 4/Input gestures dialog: when Cancel button is clicked, make…
Browse files Browse the repository at this point in the history
… sure to check if the treeview is alive. re nvaccess#7077.

Somehow, when Cancel button is licked, treeview is removed first, yet item selection event is run. Make sure to catch this.
  • Loading branch information
josephsl committed Apr 16, 2017
1 parent 8f21e03 commit ad04891
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/gui/settingsDialogs.py
Expand Up @@ -1977,7 +1977,11 @@ def _formatGesture(self, identifier):
return identifier

def onTreeSelect(self, evt):
item = self.tree.Selection
# #7077: Check if the treeview is still alive.
try:
item = self.tree.Selection
except RuntimeError:
return
data = self.tree.GetItemPyData(item)
isCommand = isinstance(data, inputCore.AllGesturesScriptInfo)
isGesture = isinstance(data, basestring)
Expand Down

0 comments on commit ad04891

Please sign in to comment.