From 61bb39be92db5896e0305f2c98cbfea0e6233a36 Mon Sep 17 00:00:00 2001 From: Stephan Sahm Date: Thu, 2 May 2024 11:18:05 +0200 Subject: [PATCH] handle empty input --- src/eval.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eval.jl b/src/eval.jl index b75e6d81..28847bc5 100644 --- a/src/eval.jl +++ b/src/eval.jl @@ -111,7 +111,7 @@ Evaluate an R expression array iteratively. If `throw_error` is `false`, the error message and warning will be thrown to stderr. """ function reval_p(expr::Ptr{ExprSxp}, env::Ptr{EnvSxp}) - local val + val = nothing protect(expr) protect(env) try @@ -122,7 +122,7 @@ function reval_p(expr::Ptr{ExprSxp}, env::Ptr{EnvSxp}) unprotect(2) end # set .Last.value - if env == Const.GlobalEnv.p + if val !== nothing && env == Const.GlobalEnv.p set_last_value(val) end val