mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix: sentry report on node is null
This commit is contained in:
parent
331ddf69d4
commit
87f55eabf6
1 changed files with 3 additions and 1 deletions
|
|
@ -66,6 +66,8 @@ function getTextNodesBetween(rootNode: Node, startNode: Node, endNode: Node) {
|
|||
}
|
||||
|
||||
function getTextNodes(node: Node) {
|
||||
if (!node) return
|
||||
|
||||
if (node == startNode) {
|
||||
pastStartNode = true
|
||||
}
|
||||
|
|
@ -384,7 +386,7 @@ export function makeHighlightNodeAttributes(
|
|||
patch: string,
|
||||
document: Document
|
||||
) {
|
||||
const rootNode = document.documentElement
|
||||
const rootNode = document.getRootNode()
|
||||
|
||||
const allArticleNodes = getTextNodesBetween(rootNode, rootNode, rootNode)
|
||||
const { highlightTextStart, highlightTextEnd, textNodes, textNodeIndex } =
|
||||
|
|
|
|||
Loading…
Reference in a new issue