Author: adrianc
Date: Sun Dec 28 00:58:44 2014
New Revision: 1648139
URL:
http://svn.apache.org/r1648139Log:
Fixed a NPE I introduced in rev 1647606. Reported by Pierre Smits on dev mailing list.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=1648139&r1=1648138&r2=1648139&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java Sun Dec 28 00:58:44 2014
@@ -972,7 +972,7 @@ public class UtilDateTime {
if (UtilValidate.isEmpty(dateFormat)) {
df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
} else {
- df = new SimpleDateFormat(dateFormat, locale);
+ df = new SimpleDateFormat(dateFormat, locale == null ? Locale.getDefault() : locale);
}
df.setTimeZone(tz);
return df;
@@ -990,7 +990,7 @@ public class UtilDateTime {
if (UtilValidate.isEmpty(dateTimeFormat)) {
df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
} else {
- df = new SimpleDateFormat(dateTimeFormat, locale);
+ df = new SimpleDateFormat(dateTimeFormat, locale == null ? Locale.getDefault() : locale);
}
df.setTimeZone(tz);
return df;
@@ -1008,7 +1008,7 @@ public class UtilDateTime {
if (UtilValidate.isEmpty(timeFormat)) {
df = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
} else {
- df = new SimpleDateFormat(timeFormat, locale);
+ df = new SimpleDateFormat(timeFormat, locale == null ? Locale.getDefault() : locale);
}
df.setTimeZone(tz);
return df;