Skip to content

Commit

Permalink
handle empty input
Browse files Browse the repository at this point in the history
  • Loading branch information
schlichtanders committed May 2, 2024
1 parent 1517803 commit 61bb39b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/eval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 61bb39b

Please sign in to comment.