Skip to content

Commit

Permalink
use Objects.toString for null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
ccutrer committed Mar 22, 2024
1 parent 2335c05 commit 5259a8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/hubspot/jinjava/el/ext/AstDict.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Object eval(Bindings bindings, ELContext context) {
// This is a hack to treat numeric keys as string keys in the dictionary.
// In most cases this is adequate since the keys are typically treated as
// strings.
key = entryKey.eval(bindings, context).toString();
key = Objects.toString(entryKey.eval(bindings, context));
} else {
throw new TemplateStateException(
"Dict key must be a string, or identifier, or a number, was: " + entryKey
Expand Down

0 comments on commit 5259a8d

Please sign in to comment.