diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 59fd80382e..e14b269d03 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -889,6 +889,10 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) { const_cast( aPad )->SetSize( pad_size + margin + margin ); margin.x = margin.y = 0; + + // Once we change the size of the pad, check that there is still a pad remaining + if( !aPad->GetSize().x || !aPad->GetSize().y ) + return; } const std::shared_ptr shapes = std::dynamic_pointer_cast( aPad->GetEffectiveShape() );