From afaf8258c8445ebe9aaa85dd7d893bfafaec4945 Mon Sep 17 00:00:00 2001 From: boutinb Date: Mon, 19 Oct 2026 17:24:14 +0200 Subject: [PATCH] editImage: return an error instead of crashing the engine interactiveJsonData was only assigned at the end of the try block, so any error while editing (e.g. a re-applied edit on a plot that cannot be edited, such as a patchwork) made building the response fail with "object 'interactiveJsonData' not found" outside the try, which killed the engine. Initialize it up front so the error is returned in the imageEdited response. Co-Authored-By: Claude Opus 5.5 --- R/common.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/common.R b/R/common.R index 8ceb8f7a..643ccac2 100644 --- a/R/common.R +++ b/R/common.R @@ -1062,6 +1062,8 @@ editImage <- function(name, optionsJson) { plot <- NULL revision <- -1 + # set before the try, so that an error while editing gives an error response instead of failing below and crashing the engine + interactiveJsonData <- NULL # uncomment to profile (and make sure that profvis is installed) # profvis::profvis(prof_output = "~/jaspDeletable/robjects/profileEditImage", expr = {