diff --git a/src/event.js b/src/event.js index f3a5d9f4..a17cf894 100644 --- a/src/event.js +++ b/src/event.js @@ -652,13 +652,15 @@ var withinElement = function( event ) { // Firefox sometimes assigns relatedTarget a XUL element // which we cannot access the parentNode property of + // Chrome does something similar, the parentNode property + // can be accessed but is null. try { // Traverse up the tree while ( parent && parent !== this ) { parent = parent.parentNode; } - if ( parent !== this ) { + if ( parent && parent !== this ) { // set the correct event type event.type = event.data;