check index in GetString()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-07-09 21:58:24 +00:00
parent 80bd086077
commit 17a6a662f7
2 changed files with 8 additions and 0 deletions

View File

@ -177,8 +177,12 @@ void wxChoice::SetString(int n, const wxString& s)
wxString wxChoice::GetString(int n) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
_T("wxChoice::GetString(): invalid index") );
return m_strings[n] ;
}
// ----------------------------------------------------------------------------
// client data
// ----------------------------------------------------------------------------

View File

@ -177,8 +177,12 @@ void wxChoice::SetString(int n, const wxString& s)
wxString wxChoice::GetString(int n) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
_T("wxChoice::GetString(): invalid index") );
return m_strings[n] ;
}
// ----------------------------------------------------------------------------
// client data
// ----------------------------------------------------------------------------