From 271826f8f33f3a9274e894bbcbaf4e8411634615 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 6 Jun 2018 00:00:39 +0100 Subject: [PATCH] Fix crash when deleting from library with nothing selected. Fixes: lp:1775289 * https://bugs.launchpad.net/kicad/+bug/1775289 --- pcbnew/load_select_footprint.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index ba6695c26b..9f614d22e6 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -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 )