Skip to content

Commit 1cbeae3

Browse files
committed
itemmodels.AbstractSortTableModel: Fix mapFromSourceRows
1 parent 9225e8d commit 1cbeae3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Orange/widgets/utils/itemmodels.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ def mapToSourceRows(self, rows):
127127
Source rows matching input rows. If they are the same,
128128
simply input `rows` is returned.
129129
"""
130-
if self.__sortInd is not None:
130+
if self.__sortInd is not None \
131+
# self.__sortInd[rows] fails if `rows` is an empty list or array
132+
and (isinstance(rows, (int, type(Ellipsis)))
133+
or len(rows)):
131134
new_rows = self.__sortInd[rows]
132135
if rows is Ellipsis:
133136
new_rows.setflags(write=False)

0 commit comments

Comments
 (0)