diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index 81c4ad5a50..5755f3ec93 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -87,10 +87,14 @@ static void existsOnLayer( LIBEVAL::CONTEXT* aCtx, void *self ) if( !item ) return; - if( !arg && aCtx->HasErrorCallback() ) + if( !arg ) { - aCtx->ReportError( wxString::Format( _( "Missing argument to '%s'" ), - wxT( "existsOnLayer()" ) ) ); + if( aCtx->HasErrorCallback() ) + { + aCtx->ReportError( wxString::Format( _( "Missing argument to '%s'" ), + wxT( "existsOnLayer()" ) ) ); + } + return; }