Skip to content

Commit

Permalink
Predictions: Fix crash when clicking on empty left area
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Jan 29, 2021
1 parent 516d3d9 commit a447bc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Orange/widgets/evaluate/owpredictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,10 @@ def select(self, selection: Union[QModelIndex, QItemSelection], flags: int):
flags that tell whether to Clear, Select, Deselect or Toggle
"""
if isinstance(selection, QModelIndex):
rows = {selection.model().mapToSource(selection).row()}
if selection.model() is not None:
rows = {selection.model().mapToSource(selection).row()}
else:
rows = set()
else:
indices = selection.indexes()
if indices:
Expand Down Expand Up @@ -1108,6 +1111,8 @@ def map_from_source(rows):
try:
yield
finally:
if self.proxy.sourceModel() is None:
return
deselected = map_from_source(old_rows - self._rows)
selected = map_from_source(self._rows - old_rows)
if selected or deselected:
Expand Down

0 comments on commit a447bc8

Please sign in to comment.