Manually check pad layers before inserting

We do not rely on GetEffectiveShape(layer) to return null for layers
that the pad does not exist on.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21523

(cherry picked from commit 2e1910ca86)
This commit is contained in:
Seth Hillbrand
2025-08-22 11:26:24 -07:00
parent 2029c5389f
commit da659f5d05
+1 -1
View File
@@ -2560,7 +2560,7 @@ std::shared_ptr<GRAPH_NODE> CREEPAGE_GRAPH::AddNetElements( int aNetCode, PCB_LA
{
for( PAD* pad : footprint->Pads() )
{
if( pad->GetNetCode() != aNetCode )
if( pad->GetNetCode() != aNetCode || !pad->GetLayerSet().test( aLayer ) )
continue;
std::shared_ptr<SHAPE> padShape = pad->GetEffectiveShape( aLayer );