From commits-return-9697-archive-asf-public=cust-asf.ponee.io@fineract.apache.org Tue Jun 2 06:05:40 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 8D86418064C for ; Tue, 2 Jun 2020 08:05:40 +0200 (CEST) Received: (qmail 90915 invoked by uid 500); 2 Jun 2020 06:05:39 -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 90906 invoked by uid 99); 2 Jun 2020 06:05:39 -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 06:05:39 +0000 From: =?utf-8?q?GitBox?= To: commits@fineract.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bfineract=5D_maektwain_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: <159107793956.10999.338779156849844023.asfpy@gitbox.apache.org> Date: Tue, 02 Jun 2020 06:05:39 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: maektwain commented on a change in pull request #960: URL: https://github.com/apache/fineract/pull/960#discussion_r433639248 ########## 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: Should I remove this? ---------------------------------------------------------------- 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