Fix a DRC crash if a zone is flagged as filled but has 0 filled areas

Fixes #5631
https://gitlab.com/kicad/code/kicad/issues/5631
This commit is contained in:
jean-pierre charras 2020-09-15 14:18:23 +02:00
parent 77caf50265
commit 52e272954f
1 changed files with 9 additions and 3 deletions

View File

@ -66,11 +66,17 @@ void DRC_MARKER_FACTORY::SetUnits( EDA_UNITS_T aUnits )
MARKER_PCB* DRC_MARKER_FACTORY::NewMarker(
TRACK* aTrack, ZONE_CONTAINER* aConflictZone, int aErrorCode ) const
{
SHAPE_POLY_SET* conflictOutline;
SHAPE_POLY_SET* conflictOutline = nullptr;
if( aConflictZone->IsFilled() )
if( !aConflictZone->GetIsKeepout() && aConflictZone->IsFilled() )
{
conflictOutline = const_cast<SHAPE_POLY_SET*>( &aConflictZone->GetFilledPolysList() );
else
if( !conflictOutline ->OutlineCount() )
conflictOutline = nullptr;
}
if( !conflictOutline )
conflictOutline = aConflictZone->Outline();
wxPoint markerPos;