From 2277ed4b172b90c561ba6d02782f04e3c6fb06ab Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Oct 2013 09:28:08 +0530 Subject: [PATCH] ... --- src/calibre/gui2/library/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 9fe8606fca..81ea3e4643 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -928,7 +928,10 @@ class BooksModel(QAbstractTableModel): # {{{ if role == Qt.DisplayRole: # orientation is vertical return QVariant(section+1) if role == Qt.DecorationRole: - return self.marked_icon if self.db.data.get_marked(self.db.data.index_to_id(section)) else self.row_decoration + try: + return self.marked_icon if self.db.data.get_marked(self.db.data.index_to_id(section)) else self.row_decoration + except (ValueError, IndexError): + pass return NONE def flags(self, index):