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
This commit is contained in:
Seth Hillbrand 2019-08-22 07:55:27 -07:00
parent de74590279
commit 03d5bf0df5
1 changed files with 1 additions and 1 deletions

View File

@ -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;