3D viewer: avoid crash in raytracing (null pointer use) if layer mask is

not shown and must be removed from silk screen layer.

Fixes #4430
https://gitlab.com/kicad/code/kicad/issues/4430
This commit is contained in:
jean-pierre charras 2020-05-14 11:50:12 +02:00
parent ad88874adf
commit 3b84653591
1 changed files with 4 additions and 2 deletions

View File

@ -620,8 +620,10 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusTextReporter, REPORTER* aWa
static_cast<const CBVHCONTAINER2D*>( mapLayers.at( layerMask_id ) );
CONST_LIST_OBJECT2D intersectionList;
containerMaskLayer2d->GetListObjectsIntersects( object2d_A->GetBBox(),
intersectionList );
if( containerMaskLayer2d ) // can be null if B_Mask or F_Mask is not shown
containerMaskLayer2d->GetListObjectsIntersects( object2d_A->GetBBox(),
intersectionList );
if( !intersectionList.empty() )
{