Author: sichen
Date: Mon Nov 12 20:47:42 2007
New Revision: 594431
URL:
http://svn.apache.org/viewvc?rev=594431&view=revLog:
prevent potential NPE from a null ReturnAdjustment.amount in getReturnAdjustmentTotal
Modified:
ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=594431&r1=594430&r2=594431&view=diff==============================================================================
--- ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Mon Nov 12 20:47:42 2007
@@ -1851,7 +1851,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) {