diff --git a/pcbnew/drc/drc_test_provider_connection_width.cpp b/pcbnew/drc/drc_test_provider_connection_width.cpp index c9db1d9983..b914a20155 100644 --- a/pcbnew/drc/drc_test_provider_connection_width.cpp +++ b/pcbnew/drc/drc_test_provider_connection_width.cpp @@ -741,8 +741,12 @@ bool DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run() for( auto& [ zone, rtree ] : board->m_CopperZoneRTreeCache ) { - if( !rtree->GetObjectsAt( location, aLayer, aMinWidth ).empty() - && zone->HitTestFilledArea( aLayer, location, aMinWidth ) ) + if( !rtree.get() ) + continue; + + auto obj_list = rtree->GetObjectsAt( location, aLayer, aMinWidth ); + + if( !obj_list.empty() && zone->HitTestFilledArea( aLayer, location, aMinWidth ) ) { contributingItems.push_back( zone ); }