drc_test_provider_connection_width: fix crash due to a null pointer.

Fix a crash (tested on W10 - MSYS2) when running DRC on the board
attached to issue #15005
Fixes #15005
https://gitlab.com/kicad/code/kicad/-/issues/15005
This commit is contained in:
jean-pierre charras 2023-06-20 16:18:50 +02:00
parent 6a19d93a5e
commit 21f2f98270
1 changed files with 6 additions and 2 deletions

View File

@ -741,8 +741,12 @@ bool DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run()
for( auto& [ zone, rtree ] : board->m_CopperZoneRTreeCache ) for( auto& [ zone, rtree ] : board->m_CopperZoneRTreeCache )
{ {
if( !rtree->GetObjectsAt( location, aLayer, aMinWidth ).empty() if( !rtree.get() )
&& zone->HitTestFilledArea( aLayer, location, aMinWidth ) ) continue;
auto obj_list = rtree->GetObjectsAt( location, aLayer, aMinWidth );
if( !obj_list.empty() && zone->HitTestFilledArea( aLayer, location, aMinWidth ) )
{ {
contributingItems.push_back( zone ); contributingItems.push_back( zone );
} }