mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02: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:
parent
6df9c90440
commit
dd604361d3
@ -99,6 +99,9 @@ wxArrayInt LISTBOX_TRICKS::listBoxDeleteSelected()
|
|||||||
wxArrayInt selections;
|
wxArrayInt selections;
|
||||||
m_listBox.GetSelections( selections );
|
m_listBox.GetSelections( selections );
|
||||||
|
|
||||||
|
if( selections.GetCount() == 0 ) // Nothing to remove
|
||||||
|
return selections;
|
||||||
|
|
||||||
std::sort( selections.begin(), selections.end() );
|
std::sort( selections.begin(), selections.end() );
|
||||||
|
|
||||||
for( int ii = selections.GetCount() - 1; ii >= 0; ii-- )
|
for( int ii = selections.GetCount() - 1; ii >= 0; ii-- )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user