From 07f139381b7e0878453241f87d71a3319ddc6b13 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 6 Oct 2020 12:49:10 +0100 Subject: [PATCH] Nullptr safety. Fixes https://gitlab.com/kicad/code/kicad/issues/5893 --- .../3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index c94d884ce4..2c467b23a4 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -853,8 +853,11 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( pLayerDispList->GetZTop() - pLayerDispList->GetZBot() ); } - m_ogl_disp_list_anti_board->ApplyScalePosition( pLayerDispList->GetZBot(), - pLayerDispList->GetZTop() - pLayerDispList->GetZBot() ); + if( m_ogl_disp_list_anti_board ) + { + m_ogl_disp_list_anti_board->ApplyScalePosition( pLayerDispList->GetZBot(), + pLayerDispList->GetZTop() - pLayerDispList->GetZBot() ); + } if( (!skipRenderHoles) && m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) &&