Fix a regression in the previous release that caused spurious error message when doing some out of band searches. Fixes #1999936 [IndexError: tuple index out of range](https://bugs.launchpad.net/calibre/+bug/1999936)

This commit is contained in:
Kovid Goyal 2022-12-17 07:57:56 +05:30
parent 1d866e0b6b
commit 6e5a424640
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -620,6 +620,13 @@ class BooksModel(QAbstractTableModel): # {{{
def current_changed(self, current, previous, emit_signal=True):
if current.isValid():
idx = current.row()
try:
self.db.id(idx)
except Exception:
# can happen if an out of band search is done causing the index
# to no longer be valid since this function is now called after
# an event loop tick.
return
try:
data = self.get_book_display_info(idx)
except Exception: