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…
Reference in New Issue