PNS: Safety for evaluating item nets for rules

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13993
This commit is contained in:
Jon Evans 2023-02-17 19:48:55 -05:00
parent 39a1b14a0f
commit 459473ccc3
2 changed files with 6 additions and 0 deletions

View File

@ -896,6 +896,9 @@ static void inDiffPairFunc( LIBEVAL::CONTEXT* aCtx, void* self )
{
NETINFO_ITEM* netinfo = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNet();
if( !netinfo )
return 0.0;
wxString refName = netinfo->GetNetname();
wxString arg = argv->AsString();
wxString baseName, coupledNet;

View File

@ -738,6 +738,9 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
int holeToHoleMin = bds.m_HoleToHoleMin;
PNS::VIA dummyVia;
if( aStartItem )
dummyVia.SetNet( aStartItem->Net() );
if( m_ruleResolver->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_HOLE_TO_HOLE, &dummyVia,
&dummyVia, UNDEFINED_LAYER, &constraint ) )
{