]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Make sure the next element is defined in addition to checking length != 0
authorkborchers <kris.borchers@gmail.com>
Mon, 6 Feb 2012 21:16:08 +0000 (15:16 -0600)
committerkborchers <kris.borchers@gmail.com>
Mon, 6 Feb 2012 21:16:08 +0000 (15:16 -0600)
ui/jquery.ui.menu.js

index ee146732b6ca96261f62eb4a55030f7155ae9123..45be5edcfeb1eaaf204bc3d3a3f431337e67b718 100644 (file)
@@ -455,7 +455,7 @@ $.widget( "ui.menu", {
                                next = this.active[ direction + "All" ]( ".ui-menu-item" ).not( ".ui-state-disabled" ).eq( 0 );
                        }
                }
-               if ( !next.length || !this.active ) {
+               if ( !next || !next.length || !this.active ) {
                        next = this.activeMenu.children( ".ui-menu-item" )[ filter ]();
                }