svn commit: r1814319 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1814319 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java

mbrohl
Author: mbrohl
Date: Sat Nov  4 19:38:12 2017
New Revision: 1814319

URL: http://svn.apache.org/viewvc?rev=1814319&view=rev
Log:
Fixed: UtilMisc.ensureLocale does not always return a valid Locale.
(OFBIZ-9964)

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java?rev=1814319&r1=1814318&r2=1814319&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java Sat Nov  4 19:38:12 2017
@@ -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;
         }