X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c7f49f569dcabe360a3a51a94eff77225b39d69..31478355f8348d7dfb1c647919b62b224acfa8a0:/src/generic/treectlg.cpp?ds=sidebyside diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 86ec19c302..986c96f5b4 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1091,7 +1091,7 @@ wxTreeItemId wxGenericTreeCtrl::GetNextChild(const wxTreeItemId& item, size_t *pIndex = (size_t *)&cookie; if ( *pIndex < children.Count() ) { - return children.Item(*pIndex++); + return children.Item((*pIndex)++); } else { @@ -2640,7 +2640,7 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) if (!next) { wxTreeItemId current = m_key_current; - while (current && !next) + while (current.IsOk() && !next) { current = GetItemParent( current ); if (current) next = GetNextSibling( current );