Skip to content

Commit

Permalink
Merge pull request biolab#1825 from janezd/fix-listview-unselect
Browse files Browse the repository at this point in the history
[FIX] Fix crash in listview if labels are changed before calling __setitem__
(cherry picked from commit 3ca9708)
  • Loading branch information
lanzagar authored and astaric committed Jan 18, 2017
1 parent 0a01feb commit adb4470
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Orange/widgets/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,10 @@ def item2name(self, item):

def __setitem__(self, index, item):
def unselect(i):
item = self.listBox.item(i)
try:
item = self.listBox.item(i)
except RuntimeError: # Underlying C/C++ object has been deleted
item = None
if item is None:
# Labels changed before clearing the selection: clear everything
self.listBox.selectionModel().clear()
Expand Down

0 comments on commit adb4470

Please sign in to comment.