Skip to content

Commit

Permalink
itemmodels.AbstractSortTableModel: Fix mapFromSourceRows
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Nov 2, 2017
1 parent 9225e8d commit 1cbeae3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Orange/widgets/utils/itemmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def mapToSourceRows(self, rows):
Source rows matching input rows. If they are the same,
simply input `rows` is returned.
"""
if self.__sortInd is not None:
if self.__sortInd is not None \
# self.__sortInd[rows] fails if `rows` is an empty list or array
and (isinstance(rows, (int, type(Ellipsis)))
or len(rows)):
new_rows = self.__sortInd[rows]
if rows is Ellipsis:
new_rows.setflags(write=False)
Expand Down

0 comments on commit 1cbeae3

Please sign in to comment.