From 3ef16221fe434ec482fa92159234896506224058 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 24 Jan 2024 23:09:38 -0500 Subject: [PATCH] Make sure default board thickness exists Fixes https://gitlab.com/kicad/code/kicad/-/issues/16733 --- pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp index f7dccbf259..f4299b71ba 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp @@ -2018,6 +2018,11 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseSetup() // not the default value (0.25mm) bds.m_SolderMaskMinWidth = 0; + // Set up a default stackup in case the file doesn't define one + BOARD_STACKUP& stackup = bds.GetStackupDescriptor(); + stackup.RemoveAll(); + stackup.BuildDefaultStackupList( &bds, m_board->GetCopperLayerCount() ); + for( T token = NextTok(); token != T_RIGHT; token = NextTok() ) { if( token != T_LEFT )