Author: sichen
Date: Thu Mar 22 15:29:55 2007
New Revision: 521507
URL:
http://svn.apache.org/viewvc?view=rev&rev=521507Log:
Null checking when getting product store locale
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java?view=diff&rev=521507&r1=521506&r2=521507==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java Thu Mar 22 15:29:55 2007
@@ -97,7 +97,12 @@
public static Locale getStoreLocale(HttpServletRequest request) {
GenericValue productStore = getProductStore(request);
- return UtilHttp.getLocale(request, request.getSession(), productStore.getString("defaultLocaleString"));
+ if (UtilValidate.isEmpty(productStore)) {
+ Debug.logError("No product store found in request, cannot set locale!", module);
+ return null;
+ } else {
+ return UtilHttp.getLocale(request, request.getSession(), productStore.getString("defaultLocaleString"));
+ }
}
public static String determineSingleFacilityForStore(GenericDelegator delegator, String productStoreId) {