Permalink
Browse files

terminate loop when etarget is falsy

clicking the document will fire the event on the HTML object and not
on the BODY object.  This will result in the loop terminating on error
when etarget becomes null
  • Loading branch information...
1 parent 60dc5a7 commit 322d2944bfbf4ca3e27831d94b0c8c5f33c2ef21 @bluesmoon committed Jan 24, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugins/rt.js
View
@@ -196,10 +196,10 @@ var impl = {
return;
}
BOOMR.debug("Click called with " + etarget.nodeName, "rt");
- while(etarget != d.body && etarget.nodeName.toUpperCase() != "A") {
+ while(etarget && etarget.nodeName.toUpperCase() != "A") {
etarget = etarget.parentNode;
}
- if(etarget.nodeName.toUpperCase()=="A") {
+ if(etarget && etarget.nodeName.toUpperCase()=="A") {
BOOMR.debug("passing through", "rt");
// user clicked a link, they may be going to another page
// if this page is being opened in a different tab, then

0 comments on commit 322d294

Please sign in to comment.