7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 14:31:42 +00:00

Fix crash saving custom stack in footprint editor

This commit is contained in:
Jon Evans 2024-11-09 08:48:11 -05:00
parent 26247b0d27
commit b3fb6bf319

View File

@ -2049,7 +2049,9 @@ void PCB_IO_KICAD_SEXPR::format( const PAD* aPad, int aNestLevel ) const
}
else
{
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu, board->GetCopperLayerCount() ) )
int layerCount = board ? board->GetCopperLayerCount() : MAX_CU_LAYERS;
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu, layerCount ) )
{
if( layer == F_Cu )
continue;