From 60ddafa4ff5263b26d17bd19a99806777884e794 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 30 Nov 2023 17:08:37 -0500 Subject: [PATCH] Guard against UNDEFINED_LAYER in GetLayerSet Fixes https://gitlab.com/kicad/code/kicad/-/issues/16230 (cherry picked from commit 1ff3b5a4370614985840683371ee77105fa0940a) --- pcbnew/pcb_track.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index 425ad6a9aa..bc668ebdbf 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -506,6 +506,9 @@ LSET PCB_VIA::GetLayerSet() const { LSET layermask; + if( m_layer < PCBNEW_LAYER_ID_START ) + return layermask; + if( GetViaType() == VIATYPE::THROUGH ) layermask = LSET::AllCuMask(); else