]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/odcombo.cpp
substitute '@b NB:' with '@note'; first partial revision of e*h headers; replace...
[wxWidgets.git] / src / generic / odcombo.cpp
index d79d692b18799668d5af6e24e5e502ebef9ef92a..d04d183089b35f8ad9f9a8b037d6ab84116d682a 100644 (file)
@@ -246,8 +246,14 @@ void wxVListBoxComboPopup::SendComboBoxEvent( int selection )
 // returns true if key was consumed
 bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode )
 {
+    const int itemCount = GetCount();
+
+    // keys do nothing in the empty control and returning immediately avoids
+    // using invalid indices below
+    if ( !itemCount )
+        return false;
+
     int value = m_value;
-    int itemCount = GetCount();
     int comboStyle = m_combo->GetWindowStyle();
 
     // this is the character equivalent of the code