Fix overly aggressive assert.

This commit is contained in:
Jeff Young 2020-07-28 13:10:49 +01:00
parent 039b6fd5cf
commit 46602148dc
1 changed files with 10 additions and 3 deletions

View File

@ -269,13 +269,20 @@ int PNS_PCBNEW_RULE_RESOLVER::Clearance( const PNS::ITEM* aA, const PNS::ITEM* a
int PNS_PCBNEW_RULE_RESOLVER::Clearance( int aNetCode ) const int PNS_PCBNEW_RULE_RESOLVER::Clearance( int aNetCode ) const
{ {
if( aNetCode > 0 && aNetCode < (int) m_netClearanceCache.size() ) if( aNetCode == 0 )
return m_netClearanceCache[aNetCode].clearance; {
else
wxFAIL_MSG( "PNS_PCBNEW_RULE_RESOLVER::Clearance: net not found in clearance cache." );
return m_defaultClearance; return m_defaultClearance;
} }
else if( aNetCode > 0 && aNetCode < (int) m_netClearanceCache.size() )
{
return m_netClearanceCache[aNetCode].clearance;
}
else
{
wxFAIL_MSG( "PNS_PCBNEW_RULE_RESOLVER::Clearance: net not found in clearance cache." );
return m_defaultClearance;
}
}
int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( const wxString& aNetName, wxString& aComplementNet, int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( const wxString& aNetName, wxString& aComplementNet,