fix possible NPE in AbstractLoanScheduleGenerator
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
aed3e41ca4
commit
b6e6eba56f
+11
-8
@@ -517,10 +517,11 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
scheduleParams.getTotalCumulativePrincipal().plus(
|
||||
currentPeriodParams.getPrincipalForThisPeriod().minus(principalProcessed)),
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
adjustCompoundedAmountWithPaidDetail(scheduleParams, lastRestDate, currentTransactions, loanApplicationTerms,
|
||||
@@ -636,10 +637,12 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
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());
|
||||
}
|
||||
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user