Skip to content

Commit

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

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

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public <T> GenerationOptionsBuilder format(Class<T> filter, PlaceholderDataForma
}

public <T> GenerationOptionsBuilder format(Class<T> filter, LocalisedPlaceholderDataFormatter<T> formatter) {
formattingOptions.add(new PlaceholderDataFormattingOption<>(obj -> obj.getClass().isAssignableFrom(filter), formatter));
formattingOptions.add(new PlaceholderDataFormattingOption<>(obj -> obj != null && obj.getClass().isAssignableFrom(filter), formatter));
return this;
}

Expand Down

0 comments on commit c5f1c59

Please sign in to comment.