This commit is contained in:
Kovid Goyal 2026-03-20 11:32:51 +05:30
parent b1ee068587
commit e98d4bb409
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -509,7 +509,7 @@ class VirtualCardContainer(QWidget):
needed: set[int] = set()
for r in range(first_row, last_row):
ri = self._rows[r]
for idx in range(ri.first_index, ri.first_index + ri.card_count):
for idx in range(ri.first_index, min(ri.first_index + ri.card_count, len(self._cards))):
needed.add(idx)
# Recycle widgets that are no longer needed