Author: jonesde
Date: Tue Apr  3 07:20:45 2007
New Revision: 525164

URL: http://svn.apache.org/viewvc?view=rev&rev=525164
Log:
Fixed bug with orderHeader being used when it might not exist, making a huge 
error message for bad variable, NPE equivalent, rather than showing order not 
found message

Modified:
    
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh

Modified: 
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh?view=diff&rev=525164&r1=525163&r2=525164
==============================================================================
--- 
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
 (original)
+++ 
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
 Tue Apr  3 07:20:45 2007
@@ -45,8 +45,6 @@
 boolean isDemoStore = true;
 if (orderId != null && orderId.length() > 0) {
     orderHeader = delegator.findByPrimaryKey("OrderHeader", 
UtilMisc.toMap("orderId", orderId));
-    productStore = orderHeader.getRelatedOneCache("ProductStore");
-    if (productStore != null) isDemoStore = 
!"N".equals(productStore.getString("isDemoStore"));
     
     // check OrderRole to make sure the user can view this order.  This check 
must be done for any order which is not anonymously placed and
     // any anonymous order when the allowAnonymousView security flag (see 
above) is not set to Y, to prevent peeking
@@ -62,6 +60,9 @@
 }
 
 if (orderHeader != null) {
+    productStore = orderHeader.getRelatedOneCache("ProductStore");
+    if (productStore != null) isDemoStore = 
!"N".equals(productStore.getString("isDemoStore"));
+
     orderReadHelper = new OrderReadHelper(orderHeader);
     orderItems = orderReadHelper.getOrderItems();
     orderAdjustments = orderReadHelper.getAdjustments();


Reply via email to