Skip to content

Commit 60269dc

Browse files
committed
Fix #145 TypeError: Cannot read property 'parentNode' of null at Cuprite.path
1 parent d7e9ffd commit 60269dc

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
@@ -41,7 +41,7 @@ class Cuprite {
4141
parents(node) {
4242
let nodes = [];
4343
let parent = node.parentNode;
44-
while (parent != document) {
44+
while (parent != document && parent !== null) {
4545
nodes.push(parent);
4646
parent = parent.parentNode;
4747
}

0 commit comments

Comments
 (0)