Author: lektran
Date: Thu Oct 18 02:10:09 2007
New Revision: 585907
URL:
http://svn.apache.org/viewvc?rev=585907&view=revLog:
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;
}
}