diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index e8a3d4f27f..c7479637fb 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -485,8 +485,14 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI netNameP = netNameBase + suffix; } - int netP = brd->FindNet( netNameP )->GetNet(); - int netN = brd->FindNet( netNameN )->GetNet(); + NETINFO_ITEM* netInfoP = brd->FindNet( netNameP ); + NETINFO_ITEM* netInfoN = brd->FindNet( netNameN ); + + if( !netInfoP || !netInfoN ) + return false; + + int netP = netInfoP->GetNet(); + int netN = netInfoN->GetNet(); if( primP ) refNet = netN;