diff --git a/src/pyj/range_utils.pyj b/src/pyj/range_utils.pyj index 540f3f9a63..d677d3df99 100644 --- a/src/pyj/range_utils.pyj +++ b/src/pyj/range_utils.pyj @@ -243,7 +243,7 @@ def get_annot_id_for(node, offset, annot_id_uuid_map): if not node: return if node.nodeType is Node.ELEMENT_NODE: - if node.dataset.calibreRangeWrapper: + if node.dataset?.calibreRangeWrapper: return annot_id_uuid_map[node.dataset.calibreRangeWrapper] if offset is 0: if node.firstChild?.nodeType is Node.ELEMENT_NODE and node.firstChild.dataset?.calibreRangeWrapper: