Skip to content

Commit 9115816

Browse files
committed
Fix cannot read property 'parentNode' of null
1 parent c835025 commit 9115816

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • lib/capybara/cuprite/javascripts

lib/capybara/cuprite/javascripts/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Cuprite {
9797
path(node) {
9898
let nodes = [node];
9999
let parent = node.parentNode;
100-
while (parent !== document) {
100+
while (parent !== document || parent !== null) {
101101
nodes.unshift(parent);
102102
parent = parent.parentNode;
103103
}

0 commit comments

Comments
 (0)