]> git.saurik.com Git - wxWidgets.git/commitdiff
Add sanity check on the item number.
authorKevin Ollivier <kevino@theolliviers.com>
Wed, 3 Feb 2010 05:22:13 +0000 (05:22 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Wed, 3 Feb 2010 05:22:13 +0000 (05:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/combobox.mm

index 56ce4b05ca3bd6577129e912c4c073df85c97845..f18378013563df9b7e85908d63d6f8cd124cc4c1 100644 (file)
@@ -94,6 +94,7 @@ int wxNSComboBoxControl::GetSelectedItem() const
 
 void wxNSComboBoxControl::SetSelectedItem(int item)
 {
+    wxASSERT_MSG(item >= 0 && item < [m_comboBox numberOfItems], "Inavlid item index.");
     [m_comboBox selectItemAtIndex: item];
 }