From 1c54f129a7476eed529d7cdcafcdb5744a9fe644 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Oct 2010 13:08:28 -0600 Subject: [PATCH] ... --- src/calibre/gui2/library/models.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 19bd38e08f..4033d3c98d 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -361,13 +361,14 @@ class BooksModel(QAbstractTableModel): # {{{ self.cover_cache.set_cache(ids) def current_changed(self, current, previous, emit_signal=True): - idx = current.row() - self.set_cache(idx) - data = self.get_book_display_info(idx) - if emit_signal: - self.new_bookdisplay_data.emit(data) - else: - return data + if current.isValid(): + idx = current.row() + self.set_cache(idx) + data = self.get_book_display_info(idx) + if emit_signal: + self.new_bookdisplay_data.emit(data) + else: + return data def get_book_info(self, index): if isinstance(index, int):