7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 12:01:41 +00:00

LISTBOX_TRICKS::listBoxDeleteSelected(): fix crash when trying to remove 0 entries.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20320
This commit is contained in:
jean-pierre charras 2025-03-12 16:03:01 +01:00
parent 6df9c90440
commit dd604361d3

View File

@ -99,6 +99,9 @@ wxArrayInt LISTBOX_TRICKS::listBoxDeleteSelected()
wxArrayInt selections;
m_listBox.GetSelections( selections );
if( selections.GetCount() == 0 ) // Nothing to remove
return selections;
std::sort( selections.begin(), selections.end() );
for( int ii = selections.GetCount() - 1; ii >= 0; ii-- )