From 46602148dc495f4474dc13aed4a0d30ab620a95f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 28 Jul 2020 13:10:49 +0100 Subject: [PATCH] Fix overly aggressive assert. --- pcbnew/router/pns_kicad_iface.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 8df97972e4..a3e8fce73f 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -269,12 +269,19 @@ int PNS_PCBNEW_RULE_RESOLVER::Clearance( const PNS::ITEM* aA, const PNS::ITEM* a int PNS_PCBNEW_RULE_RESOLVER::Clearance( int aNetCode ) const { - if( aNetCode > 0 && aNetCode < (int) m_netClearanceCache.size() ) + if( aNetCode == 0 ) + { + 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; + return m_defaultClearance; + } }