Skip to content
Permalink
Browse files
Library model: Dont raise exceptions on invalid QModelIndexes
  • Loading branch information
kovidgoyal committed Aug 16, 2021
1 parent 05dba1c commit 3843f661de657f641e5b6e0762fcd6cba0db8341
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/calibre/gui2/library/models.py
@@ -909,7 +909,7 @@ def data(self, index, role):
# in obscure cases where custom columns are both edited and added, for a time
# the column map does not accurately represent the screen. In these cases,
# we will get asked to display columns we don't know about. Must test for this.
if col >= len(self.column_to_dc_map):
if col >= len(self.column_to_dc_map) or col < 0:
return None
if role == Qt.ItemDataRole.DisplayRole:
rules = self.db.new_api.pref('column_icon_rules')

0 comments on commit 3843f66

Please sign in to comment.