From 6f9ebcfdb5059bf9a0ae3f9723c2e0538bab1115 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 17 Feb 2021 10:19:59 +0000 Subject: [PATCH] Make sure a pad has a hole before running hole test on it. Fixes https://gitlab.com/kicad/code/kicad/issues/7567 --- pcbnew/drc/drc_test_provider_disallow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pcbnew/drc/drc_test_provider_disallow.cpp b/pcbnew/drc/drc_test_provider_disallow.cpp index b5e1a0ce10..5ca3dbe133 100644 --- a/pcbnew/drc/drc_test_provider_disallow.cpp +++ b/pcbnew/drc/drc_test_provider_disallow.cpp @@ -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( item )->GetDrillSizeX() > 0; break; + default: hasHole = false; break; + } + + if( hasHole ) { item->SetFlags( HOLE_PROXY ); doCheckItem( item );