Skip to content

Commit

Permalink
Fall back to empty siblings list if no parentNode is present (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrubisch committed Jan 5, 2022
1 parent d938424 commit c91a86d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const elementToXPath = element => {
if (element === document.body) return '/html/body'

let ix = 0
const siblings = element.parentNode.childNodes
const siblings = element.parentNode ? element.parentNode.childNodes : []

for (var i = 0; i < siblings.length; i++) {
const sibling = siblings[i]
Expand Down

0 comments on commit c91a86d

Please sign in to comment.