From bd1f3340cb2d6362ed693ec35d391cbf53843b44 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 22 May 2003 18:07:05 +0000 Subject: [PATCH] fix by Egon to avoid endless loop when no matching item found git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index f0179e06f5..d1d6e0e5fb 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1315,7 +1315,7 @@ wxTreeItemId wxGenericTreeCtrl::FindItem(const wxTreeItemId& idParent, } // and try all the items (stop when we get to the one we started from) - while ( id != idParent && !GetItemText(id).Lower().StartsWith(prefix) ) + while ( id.IsOk() && (id != idParent) && !GetItemText(id).Lower().StartsWith(prefix) ) { id = GetNext(id); }