diff --git a/src/osx/listbox_osx.cpp b/src/osx/listbox_osx.cpp index 01b6ef7f0d..b00514c94f 100644 --- a/src/osx/listbox_osx.cpp +++ b/src/osx/listbox_osx.cpp @@ -439,7 +439,7 @@ void wxListBox::MacHandleSelectionChange(int row) // Otherwise call DoChangeSingleSelection so GetOldSelection() will return // the correct value if row < 0 later. const int count = static_cast(GetCount()); - if ( row < 0 || row > count ) + if ( row < 0 || row >= count ) { if ( !m_oldSelections.empty() ) {