Fix crash when delete button of footprint filter is clicked and no footprint is selected

Fixes: lp:1775296
* https://bugs.launchpad.net/kicad/+bug/1775296
This commit is contained in:
Damien Espitallier 2018-06-05 23:33:49 +02:00 committed by Jeff Young
parent a300006956
commit 5263558eaa
1 changed files with 5 additions and 0 deletions

View File

@ -555,6 +555,11 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteOneFootprintFilter( wxCommandEvent&
LIB_PART* component = m_Parent->GetCurPart();
int ii = m_FootprintFilterListBox->GetSelection();
if( ii == wxNOT_FOUND )
{
return;
}
m_FootprintFilterListBox->Delete( ii );
if( !component || ( m_FootprintFilterListBox->GetCount() == 0 ) )