mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Library model: Dont raise exceptions on invalid QModelIndexes
This commit is contained in:
parent
05dba1cad5
commit
3843f661de
@ -909,7 +909,7 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
# in obscure cases where custom columns are both edited and added, for a time
|
# 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,
|
# 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.
|
# 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
|
return None
|
||||||
if role == Qt.ItemDataRole.DisplayRole:
|
if role == Qt.ItemDataRole.DisplayRole:
|
||||||
rules = self.db.new_api.pref('column_icon_rules')
|
rules = self.db.new_api.pref('column_icon_rules')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user