Author: lektran
Date: Sat Aug 23 04:15:23 2008
New Revision: 688296
URL:
http://svn.apache.org/viewvc?rev=688296&view=revLog:
NPE fix
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java?rev=688296&r1=688295&r2=688296&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java Sat Aug 23 04:15:23 2008
@@ -120,18 +120,22 @@
return this.orig == null ? "" : this.orig;
}
if (locale == null) {
- locale = (Locale) context.get("locale");
- if (locale == null && context.containsKey("autoUserLogin")) {
- locale = UtilMisc.ensureLocale(((Map) context.get("autoUserLogin")).get("lastLocale"));
+ if (context != null) {
+ locale = (Locale) context.get("locale");
+ if (locale == null && context.containsKey("autoUserLogin")) {
+ locale = UtilMisc.ensureLocale(((Map) context.get("autoUserLogin")).get("lastLocale"));
+ }
}
if (locale == null) {
locale = Locale.getDefault();
}
}
if (timeZone == null) {
- timeZone = (TimeZone) context.get("timeZone");
- if (timeZone == null && context.containsKey("autoUserLogin")) {
- timeZone = UtilDateTime.toTimeZone((String)((Map) context.get("autoUserLogin")).get("lastTimeZone"));
+ if (context != null) {
+ timeZone = (TimeZone) context.get("timeZone");
+ if (timeZone == null && context.containsKey("autoUserLogin")) {
+ timeZone = UtilDateTime.toTimeZone((String)((Map) context.get("autoUserLogin")).get("lastTimeZone"));
+ }
}
if (timeZone == null) {
timeZone = TimeZone.getDefault();