From 1d7c5dce70a1078de4df26bc8b6cb14ce961ab51 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 8 Nov 2022 12:09:08 +0000 Subject: [PATCH] Don't attempt to write zone-connection-layers to footprint library. Fixes https://gitlab.com/kicad/code/kicad/issues/12857 --- pcbnew/plugins/kicad/pcb_plugin.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index 50409cf35a..05cfd39094 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -1603,15 +1603,18 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const if( aPad->GetKeepTopBottom() ) m_out->Print( 0, " (keep_end_layers)" ); - m_out->Print( 0, " (zone_layer_connections" ); - - for( LSEQ cu = board->GetEnabledLayers().CuStack(); cu; ++cu ) + if( board ) // Will be nullptr in footprint library { - if( aPad->ZoneConnectionCache( *cu ) == ZLC_CONNECTED ) - m_out->Print( 0, " %s", m_out->Quotew( LSET::Name( *cu ) ).c_str() ); - } + m_out->Print( 0, " (zone_layer_connections" ); - m_out->Print( 0, ")" ); + for( LSEQ cu = board->GetEnabledLayers().CuStack(); cu; ++cu ) + { + if( aPad->ZoneConnectionCache( *cu ) == ZLC_CONNECTED ) + m_out->Print( 0, " %s", m_out->Quotew( LSET::Name( *cu ) ).c_str() ); + } + + m_out->Print( 0, ")" ); + } } }