From 2df6f06c2ff4f3a51ebb07ba3c8bf5605ea57dde Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 16 Feb 2026 10:10:50 -0800 Subject: [PATCH] Fix gerbview assertion when drawing flashed shape without D_CODE Remove wxASSERT_MSG for null D_CODE in drawFlashedShape. The null guard and early return already handles this case correctly. Malformed gerber files can have items without a valid aperture code. Fixes KICAD-1089 --- gerbview/gerbview_painter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gerbview/gerbview_painter.cpp b/gerbview/gerbview_painter.cpp index 4efba900dc..f55953bc8e 100644 --- a/gerbview/gerbview_painter.cpp +++ b/gerbview/gerbview_painter.cpp @@ -483,10 +483,11 @@ void GERBVIEW_PAINTER::drawFlashedShape( GERBER_DRAW_ITEM* aItem, bool aFilled ) { D_CODE* code = aItem->GetDcodeDescr(); - wxASSERT_MSG( code, wxT( "drawFlashedShape: Item has no D_CODE!" ) ); - if( !code ) + { + wxLogDebug( wxT( "drawFlashedShape: Item has no D_CODE" ) ); return; + } m_gal->SetIsFill( aFilled ); m_gal->SetIsStroke( !aFilled );