From 44565e3787f14beb1ef1c767158f23ed98e808e1 Mon Sep 17 00:00:00 2001 From: janezd Date: Fri, 16 Dec 2016 11:21:02 +0100 Subject: [PATCH] Fix crash in listview if labels are changed before calling __setitem__ --- Orange/widgets/gui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Orange/widgets/gui.py b/Orange/widgets/gui.py index 0d2e36198f9..23e59e12aa2 100644 --- a/Orange/widgets/gui.py +++ b/Orange/widgets/gui.py @@ -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()