Check for a tree selection before checking it against the board item.

Fixes: lp:1833295
* https://bugs.launchpad.net/kicad/+bug/1833295
This commit is contained in:
Jeff Young 2019-06-19 00:06:01 +01:00
parent a6bbe907ee
commit 1996fba8a6
1 changed files with 7 additions and 3 deletions

View File

@ -572,10 +572,14 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_MODEDIT_EXPORT_PART:
if( getTargetFPID() == GetLoadedFPID() )
Export_Module( GetBoard()->m_Modules );
{
LIB_ID fpid = m_treePane->GetLibTree()->GetSelectedLibId();
if( fpid.IsValid() )
Export_Module( LoadFootprint( fpid ) );
else
Export_Module( LoadFootprint( getTargetFPID() ) );
Export_Module( GetBoard()->m_Modules );
}
break;
case ID_MODEDIT_CREATE_NEW_LIB: