Author: jacopoc
Date: Thu Apr 5 09:44:55 2012
New Revision: 1309724
URL:
http://svn.apache.org/viewvc?rev=1309724&view=revLog:
Added check to fix a NPE error preventing the purchase order creation for orders with non product items.
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?rev=1309724&r1=1309723&r2=1309724&view=diff==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Apr 5 09:44:55 2012
@@ -1080,7 +1080,7 @@ public class OrderServices {
String productId = (String) orderItem.get("productId");
GenericValue product = delegator.getRelatedOne("Product", orderItem);
- if("SERVICE_PRODUCT".equals(product.get("productTypeId")) || "AGGREGATEDSERV_CONF".equals(product.get("productTypeId"))){
+ if (product!= null && ("SERVICE_PRODUCT".equals(product.get("productTypeId")) || "AGGREGATEDSERV_CONF".equals(product.get("productTypeId")))) {
String inventoryFacilityId = null;
if ("Y".equals(productStore.getString("oneInventoryFacility"))) {
inventoryFacilityId = productStore.getString("inventoryFacilityId");