Skip to content

Commit

Permalink
Fix crash in listview if labels are changed before calling __setitem__
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Dec 23, 2016
1 parent 0572261 commit 44565e3
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 44565e3

Please sign in to comment.