Skip to content

Commit

Permalink
Added guard.
Browse files Browse the repository at this point in the history
  • Loading branch information
taras42 committed Apr 2, 2015
1 parent aa73b31 commit 004b2f1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib/html.jasmine.reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,16 @@ jasmineRequire.HtmlReporter = function(j$) {
parent = el;

while(!found){
if(parent.parentNode.id === id){
if(parent && parent.parentNode){
if(parent.parentNode.id === id){
found = true;
}

parent = parent.parentNode;
}else{
found = true;
}
parent = parent.parentNode;
parent = null;
}
}

return parent;
Expand Down

0 comments on commit 004b2f1

Please sign in to comment.