Pcb plot: fixcrash due to a null pointer

Fixes #10223
https://gitlab.com/kicad/code/kicad/issues/10223
This commit is contained in:
jean-pierre charras 2022-01-03 15:10:13 +01:00
parent 5879227ee2
commit dde629330d
1 changed files with 2 additions and 1 deletions

View File

@ -882,12 +882,13 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
for( const PCB_TRACK* track : aBoard->Tracks() )
{
const PCB_VIA* via = dyn_cast<const PCB_VIA*>( track );
int clearance = via->GetSolderMaskExpansion();
// Note: IsOnLayer() checks relevant mask layers of untented vias
if( !via || !via->IsOnLayer( layer ) )
continue;
int clearance = via->GetSolderMaskExpansion();
// add shapes with their exact mask layer size in initialPolys
via->TransformShapeWithClearanceToPolygon( initialPolys, layer, clearance, maxError,
ERROR_OUTSIDE );