Skip to content

Commit 5259a8d

Browse files
committed
use Objects.toString for null safety
1 parent 2335c05 commit 5259a8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/hubspot/jinjava/el/ext/AstDict.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Object eval(Bindings bindings, ELContext context) {
5050
// This is a hack to treat numeric keys as string keys in the dictionary.
5151
// In most cases this is adequate since the keys are typically treated as
5252
// strings.
53-
key = entryKey.eval(bindings, context).toString();
53+
key = Objects.toString(entryKey.eval(bindings, context));
5454
} else {
5555
throw new TemplateStateException(
5656
"Dict key must be a string, or identifier, or a number, was: " + entryKey

0 commit comments

Comments
 (0)