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

Caught errors from bad json in object editor fields. #540

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ambischof
Copy link
Contributor

If there was an ace editor field whose type was 'object', and the getValue was called when the entered json was invalid, it would throw an error.

Wrapped the JSON.parse call in a try catch block and upon failure, it will set it to null.

I would occasionally see this error pop up in our automated error reporter, and then a lot when working on #539, so I made this as well.

Note: the value of null seemed like the best value if the JSON is invalid, certainly better than throwing an error, but I'm open to suggestions.

If there was an ace editor field whose type was 'object', and the getValue was called when the entered json was invalid, it would throw an error.

Wrapped the JSON.parse call in a try catch block and upon failure, it will set it to null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants