You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2007/03/22 23:29:57 UTC

svn commit: r521507 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java

Author: sichen
Date: Thu Mar 22 15:29:55 2007
New Revision: 521507

URL: http://svn.apache.org/viewvc?view=rev&rev=521507
Log:
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) {