Skip to content

Commit dd4ac41

Browse files
committed
fix: csspath element null return
1 parent 96293bc commit dd4ac41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function cssPath(node, container) {
4444

4545
// pathSplits.unshift(pathSplit);
4646
node = node.parentNode;
47-
if (node.tagName == "HTML" || node.nodeName == "#document" || node.hasAttribute('contenteditable'))
47+
if (node == null || node.tagName == "HTML" || node.nodeName == "#document" || node.hasAttribute('contenteditable'))
4848
node = '';
4949
}
5050
}

0 commit comments

Comments
 (0)