From 3c135c1eebd1ee73cbd0eba8717a6ee356098f84 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 23 Aug 2020 12:32:10 +0100 Subject: [PATCH] Fix bug #1892611: Random book appears in the Quickview panel when calibre starts. --- src/calibre/gui2/dialogs/quickview.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/dialogs/quickview.py b/src/calibre/gui2/dialogs/quickview.py index 92e9ffb43f..5481c4b635 100644 --- a/src/calibre/gui2/dialogs/quickview.py +++ b/src/calibre/gui2/dialogs/quickview.py @@ -466,13 +466,15 @@ class Quickview(QDialog, Ui_Quickview): Given a cell in the library view, display the information. This method converts the index into the lookup key ''' - if self.lock_qv.isChecked(): + if self.lock_qv.isChecked() or not idx.isValid(): return try: self.current_column = ( - self.view.column_map.index('authors') if self.current_column is None and self.view.column_map[idx.column()] == 'title' - else idx.column()) + self.view.column_map.index('authors') + if self.current_column is None + and self.view.column_map[idx.column()] == 'title' + else idx.column()) key = self.view.column_map[self.current_column] book_id = self.view.model().id(idx.row()) if self.current_book_id == book_id and self.current_key == key: