fix fallthrough setting of localized metadata entries

Java's Map.get() returns null if there is no match, so this was always
setting each entry to whatever value was in the highest priority
locale, whether it had contents or what null.  Now, this will fall
through the priority list of locales until it finds actually contents.
This commit is contained in:
Hans-Christoph Steiner 2017-04-17 15:42:09 +02:00
parent 4bb7050725
commit 670e6be39a

View File

@ -433,7 +433,10 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
try {
for (String locale : locales) {
if (localized.containsKey(locale)) {
return (String) localized.get(locale).get(key);
String value = (String) localized.get(locale).get(key);
if (value != null) {
return value;
}
}
}
} catch (ClassCastException e) {