Skip to content

Commit

Permalink
Check trusted flag against BigDecimal.ZERO instead of casting to int
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvanderlinde committed Jun 16, 2023
1 parent db87bb1 commit c24abd1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Object childEvaluate(
contextName = (String) args.remove(0);
boolean makeTrusted = MapTool.getParser().isMacroTrusted();
if (args.size() > 0) {
makeTrusted = ((int) args.remove(0)) > 0;
makeTrusted = !BigDecimal.ZERO.equals(args.remove(0));
}
JSScriptEngine.registerContext(
contextName, MapTool.getParser().isMacroTrusted(), makeTrusted);
Expand Down

0 comments on commit c24abd1

Please sign in to comment.