diff --git a/src/main/java/net/rptools/maptool/client/functions/TokenPropertyFunctions.java b/src/main/java/net/rptools/maptool/client/functions/TokenPropertyFunctions.java index 52bf1c083b..6edd203686 100644 --- a/src/main/java/net/rptools/maptool/client/functions/TokenPropertyFunctions.java +++ b/src/main/java/net/rptools/maptool/client/functions/TokenPropertyFunctions.java @@ -1176,10 +1176,10 @@ private boolean hasProperty(Token token, String name) { * @throws ParserException */ private String getAllPropertyNames(String type, String delim) throws ParserException { + ArrayList namesList = new ArrayList(); if (type == null || type.length() == 0 || type.equals("*")) { Map> pmap = MapTool.getCampaign().getCampaignProperties().getTokenTypeMap(); - ArrayList namesList = new ArrayList(); for (Entry> entry : pmap.entrySet()) { for (TokenProperty tp : entry.getValue()) { @@ -1196,14 +1196,11 @@ private String getAllPropertyNames(String type, String delim) throws ParserExcep } else { List props = MapTool.getCampaign().getCampaignProperties().getTokenPropertyList(type); - if (props == null) { - throw new ParserException( - I18N.getText( - "macro.function.tokenProperty.unknownPropType", "getAllPropertyNames", type)); - } - ArrayList namesList = new ArrayList(); - for (TokenProperty tp : props) { - namesList.add(tp.getName()); + // If property type not found return an empty string or JSON array + if (props != null) { + for (TokenProperty tp : props) { + namesList.add(tp.getName()); + } } if ("json".equals(delim)) { JsonArray jarr = new JsonArray();