Browse Source

Pcbnew: footprint editor: fix crash when saving a footprint in lib

The crash was due to a footprint member (m_board) that is null in some
cases in footprint editor (renaming, saving, duplicate a Fp).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19713
pcb_db
jean-pierre charras 9 months ago
parent
commit
be38fa5cac
  1. 4
      pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp

4
pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp

@ -1365,7 +1365,9 @@ void PCB_IO_KICAD_SEXPR::format( const FOOTPRINT* aFootprint ) const
void PCB_IO_KICAD_SEXPR::formatLayers( LSET aLayerMask ) const
{
static const LSET cu_all( LSET::AllCuMask( m_board->GetCopperLayerCount() ) );
static const LSET cu_all( LSET::AllCuMask( m_board
? m_board->GetCopperLayerCount()
: MAX_CU_LAYERS ) );
static const LSET fr_bk( { B_Cu, F_Cu } );
static const LSET adhes( { B_Adhes, F_Adhes } );
static const LSET paste( { B_Paste, F_Paste } );

Loading…
Cancel
Save