From bac7b3e77a4d2816a2696e5c885e74ad63c21ad2 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 22 Feb 2021 10:12:54 -0800 Subject: [PATCH] Protect against dynamic_cast Items might not be FOOTPRINT, in which case the dynamic_cast will return nullptr. Check for this in the subfunction --- pcbnew/pcb_expr_evaluator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index f442210541..b15e89c0e4 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -169,6 +169,9 @@ static void insideCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) { SHAPE_POLY_SET footprintCourtyard; + if( !footprint ) + return false; + if( footprint->IsFlipped() ) footprintCourtyard = footprint->GetPolyCourtyardBack(); else