Skip to content

Commit

Permalink
If lang pref is empty dont attempt to load, avoids adding ""
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenR-York committed Dec 19, 2024
1 parent c4dc91a commit b0e4014
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ public void load(StringProperties properties, IRelativePathResolver resolver) th
}

this.languagePreference.clear();
for (String tag : properties.getProperty(PROPERTY_LANGUAGE_PREFERENCE).split(",")) {
this.languagePreference.add(tag.strip());
if (!properties.getProperty(PROPERTY_LANGUAGE_PREFERENCE).isEmpty()) {
for (String tag : properties.getProperty(PROPERTY_LANGUAGE_PREFERENCE).split(",")) {
this.languagePreference.add(tag.strip());
}
}

load();
Expand Down Expand Up @@ -311,6 +313,7 @@ public Map<String, String> getCustomPrefixesMap() {
}

public List<String> getLanguagePreference() {
System.out.println("returning: " +languagePreference);
return languagePreference;
}

Expand Down

0 comments on commit b0e4014

Please sign in to comment.