NPE protection in the recalcShippingTotal service

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@562521 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Si Chen
2007-08-03 16:41:52 +00:00
parent 66c22986f2
commit 74ff8a8e12
@@ -1497,7 +1497,7 @@ public class OrderServices {
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);
}