You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/12/13 12:41:27 UTC
svn commit: r890050 -
/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
Author: jleroux
Date: Sun Dec 13 11:41:26 2009
New Revision: 890050
URL: http://svn.apache.org/viewvc?rev=890050&view=rev
Log:
Fix possible NPEs
Modified:
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=890050&r1=890049&r2=890050&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Sun Dec 13 11:41:26 2009
@@ -433,7 +433,7 @@
Delegator delegator = cart.getDelegator();
GenericValue product = null;
product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId));
- if ("AGGREGATED".equals(product.getString("productTypeId"))) {
+ if (UtilValidate.isNotEmpty(product) && "AGGREGATED".equals(product.getString("productTypeId"))) {
return true;
}
} catch (GenericEntityException e) {
@@ -492,7 +492,7 @@
GenericValue product = null;
ProductConfigWrapper pcw = null;
product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId));
- if ("AGGREGATED".equals(product.getString("productTypeId"))) {
+ if (UtilValidate.isNotEmpty(product) && "AGGREGATED".equals(product.getString("productTypeId"))) {
// if it's an aggregated item, load the configwrapper and set to defaults
pcw = new ProductConfigWrapper(delegator, session.getDispatcher(), productId, null, null, null, null, null, null);
pcw.setDefaultConfig();