Also check the old selection index for validity
It's not totally clear if the old selection is always guaranteed to be valid so prefer to check it explicitly.
This commit is contained in:
@@ -444,7 +444,7 @@ void wxListBox::MacHandleSelectionChange(int row)
|
||||
if ( !m_oldSelections.empty() )
|
||||
{
|
||||
const int oldsel = m_oldSelections[0];
|
||||
if (oldsel >= 0)
|
||||
if ( oldsel >= 0 && oldsel < count )
|
||||
SetSelection(oldsel);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user