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 11, 2017
1 parent f21d554 commit f6eee7e
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 f6eee7e

Please sign in to comment.