diff --git a/pcbnew/drc/drc_rtree.h b/pcbnew/drc/drc_rtree.h index cf4a3b1b17..d12b5b3a59 100644 --- a/pcbnew/drc/drc_rtree.h +++ b/pcbnew/drc/drc_rtree.h @@ -353,7 +353,13 @@ public: [&]( ITEM_WITH_SHAPE* aItem ) -> bool { const SHAPE* shape = aItem->shape; - wxASSERT( dynamic_cast( shape ) ); + + // There are certain degenerate cases that result in empty zone fills, which + // will be represented in the rtree with only a root (and no triangles). + // https://gitlab.com/kicad/code/kicad/-/issues/18600 + if( shape->Type() != SH_POLY_SET_TRIANGLE ) + return true; + auto tri = static_cast( shape ); const SHAPE_LINE_CHAIN& outline = poly->Outline( 0 );