Menu: Ensure an event was passed before checking its type. Fixes #9384 - Menu: _focus function forgets null check with doing a pattern match on event.type

This commit is contained in:
TJ VanToll 2013-06-20 20:40:00 -04:00
parent 628a141485
commit 670f650b99

View File

@ -389,7 +389,7 @@ $.widget( "ui.menu", {
} }
nested = item.children( ".ui-menu" ); nested = item.children( ".ui-menu" );
if ( nested.length && ( /^mouse/.test( event.type ) ) ) { if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
this._startOpening(nested); this._startOpening(nested);
} }
this.activeMenu = item.parent(); this.activeMenu = item.parent();