Skip to content

Commit adb4470

Browse files
lanzagarastaric
authored andcommitted
Merge pull request biolab#1825 from janezd/fix-listview-unselect
[FIX] Fix crash in listview if labels are changed before calling __setitem__ (cherry picked from commit 3ca9708)
1 parent 0a01feb commit adb4470

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Orange/widgets/gui.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,10 @@ def item2name(self, item):
20492049

20502050
def __setitem__(self, index, item):
20512051
def unselect(i):
2052-
item = self.listBox.item(i)
2052+
try:
2053+
item = self.listBox.item(i)
2054+
except RuntimeError: # Underlying C/C++ object has been deleted
2055+
item = None
20532056
if item is None:
20542057
# Labels changed before clearing the selection: clear everything
20552058
self.listBox.selectionModel().clear()

0 commit comments

Comments
 (0)