Repository navigation
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes jasp-stats/jasp-issues#4615
Problem
When anything inside the
try()ineditImagefails, the engine crashes.interactiveJsonDatais only assigned at the end of that block. So after an error, building the response fails outside thetrywithobject 'interactiveJsonData' not found, and the engine logsEngine had an uncaught exception of: Error evaluating: jaspBase:::editImage(...)and dies.To reproduce:
debug.csvand a plot with a risk table.The plot becomes a patchwork, the desktop re-applies the stored edit, and the engine crashes.
Fix
Initialize
interactiveJsonData <- NULLbefore thetry. The error is then returned in theimageEditedresponse (error = TRUE,errorMessage), the same as other edit errors.Testing
I ran
editImagewith stubbedloadJaspResultson a patchwork plot:object 'interactiveJsonData' not found.{"status":"imageEdited","results":{..."error":true,"errorMessage":"This plot cannot be edited because it consists of multiple smaller figures."}}. That message requires Report patchwork plots as not editable instead of erroring jaspGraphs#165.Related
🤖 Generated with Claude Code