thymeleaf / thymeleaf-extras-java8time

Thymeleaf "extras" dialect for formatting and creating Java 8 Time API objects
Apache License 2.0
106 stars 34 forks source link

${#temporals.format(localDate1)} fails for the null parameter. #14

Closed ghost closed 6 years ago

ghost commented 7 years ago

If localDate1 is null, ${#temporals.format(localDate1)} fails with an error: java.lang.IllegalArgumentException: Cannot apply format on null.

But ${#dates.format(date1)} works fine with date1=null, it just output empty string for this case.

Can you please make ${#temporals.format(localDate1)} like {#dates.format(date1)} methods for the null parameter?

Now I need check for null like this: th:text="${localDate1} ? ${#temporals.format(localDate1)}".

Versions: thymeleaf.version=3.0.2.RELEASE thymeleaf-extras-java8time=3.0.0.RELEASE

jmiguelsamper commented 6 years ago

Fixed with the merge PR on 3.0.1-SNAPSHOT