You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2007/10/18 11:10:10 UTC

svn commit: r585907 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java

Author: lektran
Date: Thu Oct 18 02:10:09 2007
New Revision: 585907

URL: http://svn.apache.org/viewvc?rev=585907&view=rev
Log:
Avoid NPE

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java?rev=585907&r1=585906&r2=585907&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java Thu Oct 18 02:10:09 2007
@@ -157,7 +157,8 @@
         if (orderPaymentPreferenceSums != null) {
             for (Iterator oppsi = orderPaymentPreferenceSums.iterator(); oppsi.hasNext(); ) {
                 GenericValue orderPaymentPreferenceSum = (GenericValue) oppsi.next();
-                balance = balance.subtract(orderPaymentPreferenceSum.getBigDecimal("maxAmount"));
+                BigDecimal maxAmount = orderPaymentPreferenceSum.getBigDecimal("maxAmount");
+                balance = maxAmount != null ? balance.subtract(maxAmount) : balance;
             }
         }