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

json.get() now returns null if the field doesn't exist #1121

Closed
Merudo opened this issue Jan 15, 2020 · 1 comment
Closed

json.get() now returns null if the field doesn't exist #1121

Merudo opened this issue Jan 15, 2020 · 1 comment
Assignees
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.

Comments

@Merudo
Copy link
Member

Merudo commented Jan 15, 2020

Describe the bug
json.get() now returns null if the field doesn't exist. Previously, it returned the empty string "".

To Reproduce
Steps to reproduce the behavior:

  1. Type [h: jobj = "{}"][r: json.get(jobj, "field")]
  2. Notice the output: null.

Expected behavior
json.get returns an empty string as it did on 1.5.x.

MapTool Info

  • Version: 1.5.11 alpha 7, develop 1/15/2020
  • Install: New

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10

Additional context
The change to json.get could be intended, but we should be aware it is going to break many existing macros.

@Phergus Phergus added bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) labels Jan 15, 2020
@Merudo
Copy link
Member Author

Merudo commented Jan 16, 2020

Tested. Now that #1123 has been merged, json.get no longer returns a null when the field doesn't exist.

@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Jan 16, 2020
@Phergus Phergus closed this as completed Jan 17, 2020
Merudo added a commit to Merudo/maptool that referenced this issue Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

3 participants