Fixed: UtilMisc.ensureLocale does not always return a valid Locale.

(OFBIZ-9964)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814319 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Brohl
2017-11-04 19:38:12 +00:00
parent 8693fb0bdc
commit 002fe23568
@@ -547,7 +547,10 @@ public final class UtilMisc {
*/
public static Locale ensureLocale(Object localeObject) {
if (localeObject instanceof String) {
return parseLocale((String) localeObject);
Locale locale = parseLocale((String) localeObject);
if (locale != null) {
return locale;
}
} else if (localeObject instanceof Locale) {
return (Locale) localeObject;
}