Dont popup an error box for data lookup failures

This commit is contained in:
Kovid Goyal 2025-05-23 12:52:10 +05:30
parent 48ec47dc15
commit eaf5fcfb59
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1021,6 +1021,13 @@ class BooksModel(QAbstractTableModel): # {{{
# 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) or col < 0: if col >= len(self.column_to_dc_map) or col < 0:
return None return None
try:
return self.actual_data(index, role, col)
except Exception:
import traceback
traceback.print_exc()
def actual_data(self, index, role, col):
if role == Qt.ItemDataRole.DisplayRole: if role == Qt.ItemDataRole.DisplayRole:
rules = self.db_prefs['column_icon_rules'] rules = self.db_prefs['column_icon_rules']
if rules: if rules: