CONNECTIVITY_DATA::IsConnectedOnLayer(): fix crash in some cases.

Fix crash when a zone do not have filled areas on a given layer.
This commit is contained in:
jean-pierre charras 2022-03-12 19:00:59 +01:00
parent 5ef6e97a9e
commit 7fb4a2c0a5
1 changed files with 10 additions and 6 deletions

View File

@ -462,6 +462,9 @@ bool CONNECTIVITY_DATA::IsConnectedOnLayer( const BOARD_CONNECTED_ITEM *aItem, i
else if( CN_ZONE_LAYER* zoneLayer = dynamic_cast<CN_ZONE_LAYER*>( connected ) )
{
ZONE* zone = static_cast<ZONE*>( zoneLayer->Parent() );
if( zone->GetFill( layer )->OutlineCount() )
{
int idx = zoneLayer->SubpolyIndex();
const SHAPE_LINE_CHAIN& island = zone->GetFill( layer )->COutline( idx );
SHAPE_CIRCLE flashing( via->GetCenter(), via->GetWidth() / 2 );
@ -471,6 +474,7 @@ bool CONNECTIVITY_DATA::IsConnectedOnLayer( const BOARD_CONNECTED_ITEM *aItem, i
if( !flashing.SHAPE::Collide( pt ) )
return true;
}
}
// If the entire island is inside the via's flashing then the via won't
// *actually* connect to anything *else* so don't consider it connected.