Fix assertion statement in wxPropertyGridManager::GetPageRoot.

Simple wxASSERT should be replaced with wxCHECK_MSG to return NULL if index is out range.
This commit is contained in:
Artur Wieczorek
2015-05-24 20:33:00 +02:00
parent 7e215ee069
commit 09a78c77d0

View File

@@ -1122,8 +1122,9 @@ bool wxPropertyGridManager::IsPropertySelected( wxPGPropArg id ) const
wxPGProperty* wxPropertyGridManager::GetPageRoot( int index ) const wxPGProperty* wxPropertyGridManager::GetPageRoot( int index ) const
{ {
wxASSERT( index >= 0 ); wxCHECK_MSG( (index >= 0) && (index < (int)m_arrPages.size()),
wxASSERT( index < (int)m_arrPages.size() ); NULL,
wxT("invalid page index") );
return m_arrPages[index]->GetStatePtr()->m_properties; return m_arrPages[index]->GetStatePtr()->m_properties;
} }