7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 19:59:18 +00:00

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
This commit is contained in:
jean-pierre charras 2025-01-22 17:24:18 +01:00
parent 9a57f7d573
commit be38fa5cac

View File

@ -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 } );