From ac0969b9e90dcb9fcfc334adbd96e202ee5beca2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 30 Jun 2021 07:41:45 +0530 Subject: [PATCH] Workaround for some element nodes not having dataset --- src/pyj/read_book/cfi.pyj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyj/read_book/cfi.pyj b/src/pyj/read_book/cfi.pyj index 16089e1da4..f964ac8523 100644 --- a/src/pyj/read_book/cfi.pyj +++ b/src/pyj/read_book/cfi.pyj @@ -249,7 +249,7 @@ def node_at_index(nodes, target, index, iter_text_nodes): for i in range(nodes.length): node = nodes[i] is_element = node.nodeType is Node.ELEMENT_NODE - if is_element and node.dataset.calibreRangeWrapper: + if is_element and node.dataset?.calibreRangeWrapper: q, index = node_at_index(unwrapped_nodes(node), target, index, iter_text_nodes) if q: return q, index