Skip to content

Commit

Permalink
Catch if resolveSimplePlaceholder is passed null
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOellerer committed Aug 3, 2023
1 parent c5f1c59 commit 09bb80f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.docutools'
version = '1.6.1'
version = '1.6.2'

java {
toolchain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ private Optional<PlaceholderData> doReflectiveResolve(String placeholderName, Lo
}

private Optional<PlaceholderData> resolveSimplePlaceholder(Object property, String placeholderName, Locale locale, GenerationOptions options) {
if (property instanceof Number number) {
if (property == null) {
return Optional.empty();
} else if (property instanceof Number number) {
var numberFormat = findNumberFormat(placeholderName, locale);
return Optional.of(new ScalarPlaceholderData<>(number, numberFormat::format));
} else if (property instanceof String propertyString && isFieldAnnotatedWith(bean.getClass(), placeholderName, Translatable.class)) {
Expand Down

0 comments on commit 09bb80f

Please sign in to comment.