eagle: Fix segfault importing flipped footprints

We don't have a board reference when importing, so we don't get settings
for flip orientation.
This commit is contained in:
Seth Hillbrand 2019-07-16 06:08:58 -07:00
parent 2c5876ee8c
commit 5ff7c61003
1 changed files with 6 additions and 1 deletions

View File

@ -2215,7 +2215,12 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri
module->SetOrientation( 0 );
if( module->GetLayer() != F_Cu )
module->Flip( module->GetPosition(), m_board->GeneralSettings().m_FlipLeftRight );
{
if( m_board != nullptr )
module->Flip( module->GetPosition(), m_board->GeneralSettings().m_FlipLeftRight );
else
module->Flip( module->GetPosition(), false );
}
wxLogTrace( traceKicadPcbPlugin, wxT( "Creating s-expr footprint file '%s'." ), fullPath );
mods.insert( footprintName, new FP_CACHE_ITEM( module, WX_FILENAME( fn.GetPath(), fullName ) ) );