maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Bug]: getAllPropertyNames error on type not present

Open bubblobill opened this issue 2 years ago • 2 comments

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 avatar Apr 02 '22 10:04 bubblobill

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

Jmr3366 avatar Feb 15 '24 03:02 Jmr3366

Haven't tested it but it appears closable.

bubblobill avatar Feb 15 '24 04:02 bubblobill