Skip to content

Commit 62babac

Browse files
committed
fix(converter): Handle null and empty language in LocaleAttributeConverter
1 parent d4879fc commit 62babac

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

backend/src/main/java/net/onelitefeather/otis/database/converter/LocaleAttributeConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ public final class LocaleAttributeConverter implements AttributeConverter<Locale
1010

1111
@Override
1212
public String convertToDatabaseColumn(Locale attribute) {
13+
if (attribute == null || attribute.getLanguage().isEmpty()) {
14+
return DEFAULT.toLanguageTag();
15+
}
1316
return attribute.toLanguageTag();
1417
}
1518

0 commit comments

Comments
 (0)