Fix crash when deleting from library with nothing selected.

Fixes: lp:1775289
* https://bugs.launchpad.net/kicad/+bug/1775289
This commit is contained in:
Jeff Young 2018-06-06 00:00:39 +01:00
parent 5263558eaa
commit 271826f8f3
1 changed files with 2 additions and 6 deletions

View File

@ -490,19 +490,15 @@ wxString PCB_BASE_FRAME::SelectFootprint( EDA_DRAW_FRAME* aWindow,
if( dlg.ShowModal() == wxID_OK )
{
fpname = dlg.GetTextSelection();
fpname = dlg.GetTextSelection( 1 ) + wxT( ":" ) + fpname;
if( !dlg.GetTextSelection( 0 ).IsEmpty() )
fpname = dlg.GetTextSelection( 1 ) + wxT( ":" ) + dlg.GetTextSelection( 0 );
SkipNextLeftButtonReleaseEvent();
}
else
fpname.Empty();
}
else
{
DisplayError( aWindow, _( "No footprint found." ) );
fpname.Empty();
}
if( fpname != wxEmptyString )