mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Fix an error when processing a CFI with an invalid text offset. Fixes #1848320 [E-book viewer - Error: Unhandled error](https://bugs.launchpad.net/calibre/+bug/1848320)
This commit is contained in:
parent
95da08c893
commit
6abbf2221e
@ -468,7 +468,7 @@ def point(cfi, doc): # {{{
|
||||
try_list = [{'start':0, 'end':0, 'a':0.5}, {'start':-1, 'end':0, 'a':0}, {'start':0, 'end':1, 'a':1}]
|
||||
a = None
|
||||
rects = None
|
||||
node_len = node.nodeValue.length
|
||||
node_len = node.nodeValue.length if node.nodeValue else 0
|
||||
offset = r.offset
|
||||
for v'var i = 0; i < 2; i++':
|
||||
# Try reducing the offset by 1 if we get no match as if it refers to the position after the
|
||||
|
Loading…
x
Reference in New Issue
Block a user