From 827699bed2ea572102107bfbf2cfb5bb4f018c6a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 17 Oct 2020 13:56:20 +0100 Subject: [PATCH] Just because we have a startItem doesn't mean it can find a width. For instance, a pad with no other tracks attached will return 0. Fixes https://gitlab.com/kicad/code/kicad/issues/6019 --- pcbnew/router/pns_kicad_iface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index f702a043f9..1cd9539156 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -366,7 +366,8 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM* { trackWidth = inheritTrackWidth( aStartItem ); } - else if( bds.UseNetClassTrack() && aStartItem ) // netclass value + + if( trackWidth == 0 && bds.UseNetClassTrack() && aStartItem ) // netclass value { if( m_ruleResolver->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_WIDTH, aStartItem, nullptr, aStartItem->Layer(), &constraint ) ) @@ -374,7 +375,8 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM* trackWidth = constraint.m_Value.OptThenMin(); } } - else + + if( trackWidth == 0 ) { trackWidth = bds.GetCurrentTrackWidth(); }