Add sanity check on the item number.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -94,6 +94,7 @@ int wxNSComboBoxControl::GetSelectedItem() const
|
|||||||
|
|
||||||
void wxNSComboBoxControl::SetSelectedItem(int item)
|
void wxNSComboBoxControl::SetSelectedItem(int item)
|
||||||
{
|
{
|
||||||
|
wxASSERT_MSG(item >= 0 && item < [m_comboBox numberOfItems], "Inavlid item index.");
|
||||||
[m_comboBox selectItemAtIndex: item];
|
[m_comboBox selectItemAtIndex: item];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user