diff --git a/pcbnew/router/pns_item.cpp b/pcbnew/router/pns_item.cpp index 130736a054..5cbaf70906 100644 --- a/pcbnew/router/pns_item.cpp +++ b/pcbnew/router/pns_item.cpp @@ -150,12 +150,12 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode, int aLayer, } // And a special case for the "head" via's hole. - if( holeH && shouldWeConsiderHoleCollisions( this, holeH ) ) + if( aHead->HasHole() && shouldWeConsiderHoleCollisions( this, holeH ) ) { if( Net() != holeH->Net() && collideSimple( holeH, aNode, aLayer, aCtx ) ) collisionsFound = true; } - if( holeI && shouldWeConsiderHoleCollisions( holeI, aHead ) ) + if( HasHole() && shouldWeConsiderHoleCollisions( holeI, aHead ) ) { collisionsFound |= holeI->collideSimple( aHead, aNode, aLayer, aCtx ); } diff --git a/pcbnew/router/router_preview_item.cpp b/pcbnew/router/router_preview_item.cpp index 6f9cd21e0e..14b527f228 100644 --- a/pcbnew/router/router_preview_item.cpp +++ b/pcbnew/router/router_preview_item.cpp @@ -69,7 +69,7 @@ ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const PNS::ITEM* aItem, PNS::ROUTER_IF // TODO(JE) padstacks -- need to know the layer here m_shape = aItem->Shape( -1 )->Clone(); - if( aItem->Hole() ) + if( aItem->HasHole() ) m_hole = aItem->Hole()->Shape( -1 )->Clone(); } @@ -187,7 +187,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS::ITEM* aItem ) delete m_hole; m_hole = nullptr; - if( aItem->Hole() ) + if( aItem->HasHole() ) m_hole = aItem->Hole()->Shape( -1 )->Clone(); break;