From 5ff7c61003d787a39e382e72a548390925c0ceb4 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 16 Jul 2019 06:08:58 -0700 Subject: [PATCH] eagle: Fix segfault importing flipped footprints We don't have a board reference when importing, so we don't get settings for flip orientation. --- pcbnew/kicad_plugin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index e5be5ce441..a2e7eefbe6 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -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 ) ) );