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

[Bug]: getAllPropertyNames error on type not present #3387

Open
bubblobill opened this issue Apr 2, 2022 · 2 comments
Open

[Bug]: getAllPropertyNames error on type not present #3387

bubblobill opened this issue Apr 2, 2022 · 2 comments
Assignees
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)

Comments

@bubblobill
Copy link
Collaborator

bubblobill commented Apr 2, 2022

Describe the Bug

getAllPropertyNames(type, delim) creates an error causing macros to stop running where the type does not exist in the Camapaign Properties.

To Reproduce

  1. Copy the following -> [r: getAllPropertyNames("Franco_Prussian_Soldier_Specialist_Artillerest_16thCentury", "json")]
  2. Paste into chat, press Enter.
  3. Read the error message.

Expected Behaviour

I would expect it to return an empty set or false.
Without being able to determine what token types exist within the campaign there is no way to know if the function is safe to call.
Accordingly I would expect it to return something useful that can be handled in code if the type is not present.

Screenshots

No response

MapTool Info

1.11.4

Desktop

Win10

Additional Context

No response

@bubblobill bubblobill added the bug label Apr 2, 2022
@thelsing thelsing added the macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) label Apr 7, 2022
@Phergus Phergus self-assigned this Aug 15, 2022
@Jmr3366
Copy link
Contributor

Jmr3366 commented Feb 15, 2024

It is not clear to me if this should be closed from #3548
#4697 could also mitigate the issue (by checking first)

@bubblobill
Copy link
Collaborator Author

Haven't tested it but it appears closable.

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)
Projects
None yet
Development

No branches or pull requests

4 participants