From commits-return-9686-archive-asf-public=cust-asf.ponee.io@fineract.apache.org Tue Jun 2 05:02:13 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 08920180665 for ; Tue, 2 Jun 2020 07:02:12 +0200 (CEST) Received: (qmail 9655 invoked by uid 500); 2 Jun 2020 05:02:11 -0000 Mailing-List: contact commits-help@fineract.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fineract.apache.org Delivered-To: mailing list commits@fineract.apache.org Received: (qmail 9646 invoked by uid 99); 2 Jun 2020 05:02:11 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2020 05:02:11 +0000 From: =?utf-8?q?GitBox?= To: commits@fineract.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bfineract=5D_vorburger_commented_on_a_change_in_pul?= =?utf-8?q?l_request_=23960=3A_FINERACT-977-fix_possible_NPE_in_AbstractLoan?= =?utf-8?q?ScheduleGenerator?= Message-ID: <159107413123.10999.4500413130576301016.asfpy@gitbox.apache.org> Date: Tue, 02 Jun 2020 05:02:11 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: vorburger commented on a change in pull request #960: URL: https://github.com/apache/fineract/pull/960#discussion_r433621124 ########## File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java ########## @@ -636,10 +637,12 @@ private void updateAmountsBasedOnCurrentEarlyPayments(final MathContext mc, fina scheduleParams.getReducePrincipal(), scheduleParams.getTotalCumulativePrincipal().plus(currentPeriodParams.getPrincipalForThisPeriod()) .plus(currentPeriodParams.getEarlyPaidAmount()), scheduleParams.getPeriodNumber() + 1, mc)); - if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment() - && fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) { - currentPeriodParams.setEmiAmountChanged(true); - } + if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment() + && fixedEmiAmount != null + && fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) { + currentPeriodParams.setEmiAmountChanged(true); + currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount()); Review comment: Whoa! @maektwain hang on - you probably mistakenly added this extra duplicate line here, right? :sob: Or was this intentional, and I'm not getting it? I'm proposing to remove it again in #967... do you agree? (I'm not sure if it's causing FINERACT-855 or if that's an unrelated problem.) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org