X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edc0a395c60f72a065d451778d64969739bf9534..b2458f311b426717c4d36b51aed2595a59f373d9:/src/common/containr.cpp diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 55b6109a9b..185f8098d9 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -369,12 +369,18 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) for ( ;; ) { // don't go into infinite loop - if ( start_node && node == start_node ) + if ( start_node && node && node == start_node ) break; // Have we come to the last or first item on the panel? if ( !node ) { + if ( !start_node ) + { + // exit now as otherwise we'd loop forever + break; + } + if ( !goingDown ) { // Check if our (maybe grand) parent is another panel: if this