- wxASSERT ( position > -1 && position < m_items.GetCount() );
- if ( position > -1 && position < m_items.GetCount() )
- return m_items.Item( position )->GetData();
- else
- return NULL;
+ wxCHECK_MSG( position < m_items.GetCount(), NULL,
+ _T("wxMenu::FindItemByPosition(): invalid menu index") );
+
+ return m_items.Item( position )->GetData();