fixed spurious assert in FindControl() (backported from trunk)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-03-03 00:01:51 +00:00
parent bcba0550bd
commit 98cbc5c60b

View File

@@ -212,14 +212,22 @@ wxControl *wxToolBarBase::FindControl( int id )
node; node;
node = node->GetNext() ) node = node->GetNext() )
{ {
wxControl *control = node->GetData()->GetControl(); const wxToolBarToolBase * const tool = node->GetData();
if ( tool->IsControl() )
if (control)
{ {
if (control->GetId() == id) wxControl * const control = tool->GetControl();
if ( !control )
{
wxFAIL_MSG( _T("NULL control in toolbar?") );
}
else if ( control->GetId() == id )
{
// found
return control; return control;
} }
} }
}
return NULL; return NULL;
} }