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/08/03 18:41:55 UTC
svn commit: r562521 -
/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Author: sichen
Date: Fri Aug 3 09:41:52 2007
New Revision: 562521
URL: http://svn.apache.org/viewvc?view=rev&rev=562521
Log:
NPE protection in the recalcShippingTotal service
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=562521&r1=562520&r2=562521
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Aug 3 09:41:52 2007
@@ -1497,7 +1497,7 @@
shippingTotal = ZERO;
Debug.log("No valid order items found - " + shippingTotal, module);
} else {
- shippingTotal = new BigDecimal(((Double) shippingEstMap.get("shippingTotal")).doubleValue());
+ shippingTotal = UtilValidate.isEmpty(shippingEstMap.get("shippingTotal")) ? ZERO : new BigDecimal(((Double) shippingEstMap.get("shippingTotal")).doubleValue());
shippingTotal = shippingTotal.setScale(orderDecimals, orderRounding);
Debug.log("Got new shipping estimate - " + shippingTotal, module);
}