From 36d6644879e1cafb004bcb4ae8170841ff634df4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 16 Jun 2020 14:06:36 +0200 Subject: [PATCH] IDEMPIERE-4324 Fix NPE on payment allocation (#115) Co-authored-by: Orlando Curieles --- .../src/org/compiere/acct/Doc_AllocationHdr.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 7eb169d1b4..f6b62dd51f 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -230,9 +230,10 @@ public class Doc_AllocationHdr extends Doc { fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()), getC_Currency_ID(), line.getAmtSource(), null); - if (fl != null && payment != null) + if (fl != null && payment != null) { fl.setAD_Org_ID(payment.getAD_Org_ID()); - allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance()); + allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance()); + } } else {