Fix #1242291 [ValueError:min() arg is an empty sequence](https://bugs.launchpad.net/calibre/+bug/1242291)

This commit is contained in:
Kovid Goyal 2013-10-20 16:58:18 +05:30
parent 2fae9e67c7
commit 7c2f6056d6

View File

@ -700,7 +700,8 @@ class BooksView(QTableView): # {{{
except ValueError: except ValueError:
pass pass
sections = tuple(x for x in map(f, changed) if x is not None) sections = tuple(x for x in map(f, changed) if x is not None)
self.row_header.headerDataChanged(Qt.Vertical, min(sections), max(sections)) if sections:
self.row_header.headerDataChanged(Qt.Vertical, min(sections), max(sections))
else: else:
# Marked items have either appeared or all been removed # Marked items have either appeared or all been removed
self.model().set_row_decoration(current_marked) self.model().set_row_decoration(current_marked)