From 140e4cbe28b4fdeaf86bf4737645fc33ce79e46b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 22 Sep 2021 12:37:17 -0700 Subject: [PATCH] Avoid assertion on 2-layer board New boards may have INVALID_LAYER inbetween F_Cu and B_Cu in the stackup. Skip these and any layer values beyond what we store currently --- pcbnew/tools/drawing_stackup_table_tool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/tools/drawing_stackup_table_tool.cpp b/pcbnew/tools/drawing_stackup_table_tool.cpp index e1c3551f18..a488609645 100644 --- a/pcbnew/tools/drawing_stackup_table_tool.cpp +++ b/pcbnew/tools/drawing_stackup_table_tool.cpp @@ -295,6 +295,9 @@ std::vector DRAWING_TOOL::DrawSpecificationStackup( const wxPoint& for( i = 0; i < stackup.GetCount(); i++ ) { + if( !IsValidLayer( layers.at( i )->GetBrdLayerId() ) ) + continue; + for( j = 0; j < layers.at( i )->GetSublayersCount(); j++ ) { // Layer names are empty until we close at least once the board setup dialog.