From a9be08e1cec4f65336459ab7ce7b40865d736099 Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Mon, 9 Nov 2020 22:22:36 +0000 Subject: [PATCH] 3D-Viewer: skip layers not created Fixes https://gitlab.com/kicad/code/kicad/issues/6324 --- .../c3d_render_createscene_ogl_legacy.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp index b6b7fad225..a598248a4e 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp @@ -628,12 +628,11 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER* aStatusReporter, REPORTER* aWarnin const CBVHCONTAINER2D *container2d = static_cast(ii->second); // Load the vertical (Z axis) component of shapes - const SHAPE_POLY_SET *aPolyList = nullptr; - if( map_poly.find( layer_id ) != map_poly.end() ) - { - aPolyList = map_poly.at( layer_id ); - } + if( map_poly.find( layer_id ) == map_poly.end() ) + continue; + + const SHAPE_POLY_SET *aPolyList = map_poly.at( layer_id ); SHAPE_POLY_SET polyListSubtracted; polyListSubtracted = *aPolyList;