Fix crashes when switching libraries with marked books

Fix a bug that could cause calibre to crash when switching from a large
library to a smaller library with marked books. Fixes #1239210 [Calibre 1.6 64bits crashes when changing library](https://bugs.launchpad.net/calibre/+bug/1239210)
This commit is contained in:
Kovid Goyal 2013-10-13 07:36:49 +05:30
parent de2dbf73cd
commit 22289f95d4

View File

@ -66,7 +66,7 @@ class HeaderView(QHeaderView): # {{{
try:
opt.icon = model.headerData(logical_index, opt.orientation, Qt.DecorationRole)
opt.iconAlignment = Qt.AlignVCenter
except TypeError:
except (IndexError, ValueError, TypeError):
pass
if sm.isRowSelected(logical_index, QModelIndex()):
opt.state |= QStyle.State_Sunken