Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
fix edge case where event target or relatedTarget were null
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed May 7, 2014
1 parent f16090b commit bf31547
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/targetfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
if (a === b) {
return a;
}
if (a && !b) {
return a;
}
if (b && !a) {
return b;
}
if (!b && !a) {
return document;
}
// fast case, a is a direct descendant of b or vice versa
if (a.contains) {
if (a.contains(b)) {
Expand Down

0 comments on commit bf31547

Please sign in to comment.