Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when when SETting parent to self or descendant #2412

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

96LawDawg
Copy link
Collaborator

@96LawDawg 96LawDawg commented Dec 25, 2024

Fixes #1414 for both routine operations and invalid typed entries in the JSON Editor.

There is a quirk with the editor that I cannot figure out. Instead of getting red warning text, you get an alert pop-up with the warning. When the pop-up is closed, the invalid parent still shows up in the editor, but it has not been applied.

I tried changing the jeGetContext function in jsonedit.js in the try block. But there were multiple problems with everything I tried.

What is currently in this code is better than what we have and it works as is to prevent crashes and provide warning. But it could be improved.


PR-SERVER-BOT: You can play around with it here: https://test.virtualtabletop.io/PR-2412/pr-test (or any other room on that server)

Fixes #1414 for both routine operations and invalid typed entries in the JSON Editor.

There is a quirk with the editor that I cannot figure out.  Instead of getting red warning text, you get an alert pop-up with the warning.  When the pop-up is closed, the invalid parent still shows up in the editor, but it has not been applied.

I tried changing the jeGetContext function in jsonedit.js in the try block. But there were multiple problems with everything I tried.

What is currently in this code is better than what we have and it works as is to prevent crashes and provide warning. But it could be improved.
@96LawDawg 96LawDawg added bug Something isn't working editor routine operations changes to button behavior labels Dec 25, 2024
Copy link
Owner

@ArnoldSmith86 ArnoldSmith86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this looks at currentParent.state.parent instead of currentParent.get('parent')?

@96LawDawg
Copy link
Collaborator Author

Any reason why this looks at currentParent.state.parent instead of currentParent.get('parent')?

No reason. Fixed. Tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor routine operations changes to button behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SET parent to self crashes the client
2 participants