Author: diveshdutta
Date: Sat May 7 17:33:34 2016
New Revision: 1742737
URL:
http://svn.apache.org/viewvc?rev=1742737&view=revLog:
(OFBIZ-7045) Fixed: Non existent item when added as Bulk Item while creating purchase order is throwing null pointer exception. Thanks Swapnil Shah for reporting the issue and thanks Devanshu Vyas for providing the patch.
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1742737&r1=1742736&r2=1742737&view=diff==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Sat May 7 17:33:34 2016
@@ -647,7 +647,7 @@ public class ShoppingCartEvents {
try {
GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
//Reset shipment method information in cart only if shipping applies on product.
- if (ProductWorker.shippingApplies(product)) {
+ if (UtilValidate.isNotEmpty(product) && ProductWorker.shippingApplies(product)) {
for (int shipGroupIndex = 0; shipGroupIndex < cart.getShipGroupSize(); shipGroupIndex++) {
String shipContactMechId = cart.getShippingContactMechId(shipGroupIndex);
if (UtilValidate.isNotEmpty(shipContactMechId)) {