From 77f47b6e47726207b8d634ed941efa59014c72a0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 26 Sep 2021 10:54:50 +0200 Subject: [PATCH] Avoid assertion in some cases. --- pcbnew/tools/drawing_stackup_table_tool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/drawing_stackup_table_tool.cpp b/pcbnew/tools/drawing_stackup_table_tool.cpp index 6c1dcb560f..652b540d2d 100644 --- a/pcbnew/tools/drawing_stackup_table_tool.cpp +++ b/pcbnew/tools/drawing_stackup_table_tool.cpp @@ -305,7 +305,10 @@ std::vector DRAWING_TOOL::DrawSpecificationStackup( const wxPoint& // In this case, for dielectric, a dummy name will be used if( stackup_item->GetLayerName().IsEmpty() ) { - wxString ly_name = m_frame->GetBoard()->GetLayerName( stackup_item->GetBrdLayerId() ); + wxString ly_name; + + if( IsValidLayer( stackup_item->GetBrdLayerId() ) ) + ly_name = m_frame->GetBoard()->GetLayerName( stackup_item->GetBrdLayerId() ); if( ly_name.IsEmpty() && stackup_item->GetType() == BS_ITEM_TYPE_DIELECTRIC ) ly_name = _( "Dielectric" );