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/11/13 05:47:28 UTC
svn commit: r594430 -
/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Author: sichen
Date: Mon Nov 12 20:47:27 2007
New Revision: 594430
URL: http://svn.apache.org/viewvc?rev=594430&view=rev
Log:
prevent potential NPE from a null ReturnAdjustment.amount in getReturnAdjustmentTotal
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=594430&r1=594429&r2=594430&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Mon Nov 12 20:47:27 2007
@@ -2229,7 +2229,9 @@
Iterator adjustmentIterator = adjustments.iterator();
while (adjustmentIterator.hasNext()) {
GenericValue returnAdjustment = (GenericValue) adjustmentIterator.next();
- total += returnAdjustment.getDouble("amount").doubleValue();
+ if ((returnAdjustment != null) && (returnAdjustment.get("amount") != null)) {
+ total += returnAdjustment.getDouble("amount").doubleValue();
+ }
}
}
} catch (org.ofbiz.entity.GenericEntityException e) {