From 4f3117aea0dab6fb5471831efe29f41fe134e37c Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 17 May 2024 20:15:51 -0400 Subject: [PATCH] Altium: avoid crash when imported zone has no fill Fix https://gitlab.com/kicad/code/kicad/-/issues/18025 --- pcbnew/pcb_io/altium/altium_pcb.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 434499d400..6c98675d0f 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -2783,6 +2783,9 @@ void ALTIUM_PCB::ConvertArcs6ToBoardItem( const AARC6& aElem, const int aPrimiti if( klayer == UNDEFINED_LAYER ) return; // Just skip it for now. Users can fill it themselves. + if( !zone->HasFilledPolysForLayer( klayer ) ) + return; + SHAPE_POLY_SET* fill = zone->GetFill( klayer ); // This is not the actual board item. We can use it to create the polygon for the region @@ -3715,6 +3718,9 @@ void ALTIUM_PCB::ConvertTracks6ToBoardItem( const ATRACK6& aElem, const int aPri if( klayer == UNDEFINED_LAYER ) return; // Just skip it for now. Users can fill it themselves. + if( !zone->HasFilledPolysForLayer( klayer ) ) + return; + SHAPE_POLY_SET* fill = zone->GetFill( klayer ); PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );