diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index 4342deb27c..83e91dbfab 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -192,9 +192,8 @@ void wxChoice::DoSetItemClientData( int n, void* clientData ) void *wxChoice::DoGetItemClientData(int n) const { - if ( n < 0 || (size_t)n >= m_datas.GetCount() ) - return (void*)NULL; - + wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL, + wxT("invalid index in wxChoice::GetClientData") ); return (void *)m_datas[n]; } diff --git a/src/mac/choice.cpp b/src/mac/choice.cpp index 4342deb27c..83e91dbfab 100644 --- a/src/mac/choice.cpp +++ b/src/mac/choice.cpp @@ -192,9 +192,8 @@ void wxChoice::DoSetItemClientData( int n, void* clientData ) void *wxChoice::DoGetItemClientData(int n) const { - if ( n < 0 || (size_t)n >= m_datas.GetCount() ) - return (void*)NULL; - + wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL, + wxT("invalid index in wxChoice::GetClientData") ); return (void *)m_datas[n]; }