Skip to content

Commit

Permalink
Merge pull request #4153 from kwvanderlinde/bugfix/4151-js.createNS-C…
Browse files Browse the repository at this point in the history
…lassCastException

Check trusted flag against BigDecimal.ZERO instead of casting to int
  • Loading branch information
cwisniew committed Jun 17, 2023
2 parents e944319 + c24abd1 commit 98c0547
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 98c0547

Please sign in to comment.