Make sure a pad has a hole before running hole test on it.

Fixes https://gitlab.com/kicad/code/kicad/issues/7567
This commit is contained in:
Jeff Young 2021-02-17 10:19:59 +00:00
parent e822977367
commit 6f9ebcfdb5
1 changed files with 10 additions and 1 deletions

View File

@ -103,7 +103,16 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
item->ClearFlags( HOLE_PROXY );
doCheckItem( item );
if( item->Type() == PCB_VIA_T || item->Type() == PCB_PAD_T )
bool hasHole;
switch( item->Type() )
{
case PCB_VIA_T: hasHole = true; break;
case PCB_PAD_T: hasHole = static_cast<PAD*>( item )->GetDrillSizeX() > 0; break;
default: hasHole = false; break;
}
if( hasHole )
{
item->SetFlags( HOLE_PROXY );
doCheckItem( item );