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:
		
							parent
							
								
									4bb7050725
								
							
						
					
					
						commit
						670e6be39a
					
				| @ -433,7 +433,10 @@ public class App extends ValueObject implements Comparable<App>, Parcelable { | |||||||
|         try { |         try { | ||||||
|             for (String locale : locales) { |             for (String locale : locales) { | ||||||
|                 if (localized.containsKey(locale)) { |                 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) { |         } catch (ClassCastException e) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Hans-Christoph Steiner
						Hans-Christoph Steiner