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) {


Reply via email to