From 5259a8d82e5a4b00664a8ad6de7a99d99c82bfae Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Fri, 22 Mar 2024 12:41:39 -0600 Subject: [PATCH] use Objects.toString for null safety --- src/main/java/com/hubspot/jinjava/el/ext/AstDict.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java b/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java index a2181659c..01e626bf6 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java @@ -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