X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e567904ae6f502226659fac12f22b6a18beb2179..a5655d37db9baabce654849fd66173f95f74e230:/src/osx/combobox_osx.cpp diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index 214bdbdff4..8ab1cf9c1e 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -186,12 +186,15 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const wxString wxComboBox::GetString(unsigned int n) const { + wxCHECK_MSG( n < GetCount(), wxString(), "Invalid combobox index" ); + return GetComboPeer()->GetStringAtIndex(n); } wxString wxComboBox::GetStringSelection() const { - return GetString(GetSelection()); + const int sel = GetSelection(); + return sel == wxNOT_FOUND ? wxString() : GetString(sel); } void wxComboBox::SetString(unsigned int n, const wxString& s)