mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Protect against invalid pads
Before dereferencing the front of the sequence, we have to ensure that the pad exists on any layer. If not, just return the default (probably F_Cu) for the element
This commit is contained in:
parent
34e706bcbc
commit
359d66bc81
@ -209,10 +209,11 @@ PCB_LAYER_ID PAD::GetLayer() const
|
||||
|
||||
PCB_LAYER_ID PAD::GetPrincipalLayer() const
|
||||
{
|
||||
if( m_attribute == PAD_ATTRIB::SMD || m_attribute == PAD_ATTRIB::CONN )
|
||||
if( m_attribute == PAD_ATTRIB::SMD || m_attribute == PAD_ATTRIB::CONN || GetLayerSet().none() )
|
||||
return m_layer;
|
||||
else
|
||||
return GetLayerSet().Seq().front();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user