From e93cdcb38c44baa3d62537409f281860918abc01 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 4 Sep 2020 21:38:20 +0200 Subject: [PATCH] IDEMPIERE-4440 NPE in DocAllocationHdr (#241) --- .../src/org/compiere/acct/Doc_AllocationHdr.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index fb8381a14a..7eb355217b 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -420,7 +420,8 @@ public class Doc_AllocationHdr extends Doc getC_Currency_ID(), null, line.getAmtSource().negate()); if (fl != null && payment != null) fl.setAD_Org_ID(payment.getAD_Org_ID()); - allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance().negate()); + if (fl != null) + allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance().negate()); } else if (isUsingClearing && line.getC_CashLine_ID() != 0) // Avoid usage of clearing accounts {