From 03d5bf0df54190432fe42433bd8672aac5dca649 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 22 Aug 2019 07:55:27 -0700 Subject: [PATCH] PNS: Check that we are optimizing a pad Vias are also sent to breakout optimizer, so we need to check for the solid cast before dereference. Fixes: lp:1841057 * https://bugs.launchpad.net/kicad/+bug/1841057 --- pcbnew/router/pns_optimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index 60a375b83c..c195053914 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -851,7 +851,7 @@ int OPTIMIZER::smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVert for( int p = 1; p <= p_end; p++ ) { // If the line is contained inside the pad, don't optimize - if( solid->Shape() && !solid->Shape()->Collide( + if( solid && solid->Shape() && !solid->Shape()->Collide( SEG( line.CPoint( 0 ), line.CPoint( p ) ), aLine->Width() / 2 ) ) continue;