Skip to content

Commit 89a2052

Browse files
lionel-DavisVaughan
andcommitted
Don't update call field if there is already information
Co-authored-by: Davis Vaughan <davis@posit.co>
1 parent 7d85726 commit 89a2052

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/harp/src/exec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ pub fn try_eval(expr: SEXP, env: SEXP) -> crate::Result<RObject> {
9696
let mut res = try_catch(|| unsafe { Rf_eval(expr, env) }).map(RObject::from);
9797

9898
if let Err(Error::TryCatchError { ref mut call, .. }) = res {
99-
*call = Some(unsafe { r_stringify(expr, "\n")? });
99+
if call.is_none() {
100+
*call = Some(unsafe { r_stringify(expr, "\n")? });
101+
}
100102
}
101103

102104
res

0 commit comments

Comments
 (0)