We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dbbfc5 commit 23e2b99Copy full SHA for 23e2b99
1 file changed
src/main/java/com/hubspot/jinjava/lib/fn/Functions.java
@@ -161,11 +161,11 @@ public static ZonedDateTime today(String... var) {
161
public static String dateTimeFormat(Object var, String... format) {
162
ZoneId zoneOffset = ZoneOffset.UTC;
163
164
- if (format.length > 1) {
+ if (format.length > 1 && format[1] != null) {
165
String timezone = format[1];
166
try {
167
zoneOffset = ZoneId.of(timezone);
168
- } catch (DateTimeException | NullPointerException e) {
+ } catch (DateTimeException e) {
169
throw new InvalidArgumentException(
170
JinjavaInterpreter.getCurrent(),
171
"datetimeformat",
0 commit comments