From 504c8bf2866b3748c16a3d7dd939297e993798de Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Thu, 5 Mar 2015 10:01:54 +0100 Subject: [PATCH] router: fix segfault on misnamed DP complementary net --- pcbnew/router/pns_diff_pair_placer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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;