mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-18 17:03:23 +02:00
Fix #998248 (Version 08.51 Error opening some books with viewer)
This commit is contained in:
parent
1e7dbcc4cb
commit
cddf8eaf52
1 changed files with 4 additions and 1 deletions
|
|
@ -62,7 +62,10 @@ def __init__(self, spine, toc_entry, num):
|
|||
self.text = toc_entry.text or _('Unknown')
|
||||
self.key = toc_entry.abspath
|
||||
self.anchor = self.start_anchor = toc_entry.fragment or None
|
||||
self.spine_pos = spine.index(self.key)
|
||||
try:
|
||||
self.spine_pos = spine.index(self.key)
|
||||
except ValueError:
|
||||
self.spine_pos = -1
|
||||
self.anchor_pos = 0
|
||||
if self.spine_pos > -1:
|
||||
self.anchor_pos = spine[self.spine_pos].anchor_map.get(self.anchor,
|
||||
|
|
|
|||
Loading…
Reference in a new issue