fix possible NPE in AbstractLoanScheduleGenerator
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
aed3e41ca4
commit
b6e6eba56f
+3
@@ -518,6 +518,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
|||||||
currentPeriodParams.getPrincipalForThisPeriod().minus(principalProcessed)),
|
currentPeriodParams.getPrincipalForThisPeriod().minus(principalProcessed)),
|
||||||
scheduleParams.getPeriodNumber() + 1, mc));
|
scheduleParams.getPeriodNumber() + 1, mc));
|
||||||
if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment()
|
if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment()
|
||||||
|
&& fixedEmiAmount != null
|
||||||
&& fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
&& fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
||||||
currentPeriodParams.setEmiAmountChanged(true);
|
currentPeriodParams.setEmiAmountChanged(true);
|
||||||
}
|
}
|
||||||
@@ -637,8 +638,10 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
|||||||
scheduleParams.getTotalCumulativePrincipal().plus(currentPeriodParams.getPrincipalForThisPeriod())
|
scheduleParams.getTotalCumulativePrincipal().plus(currentPeriodParams.getPrincipalForThisPeriod())
|
||||||
.plus(currentPeriodParams.getEarlyPaidAmount()), scheduleParams.getPeriodNumber() + 1, mc));
|
.plus(currentPeriodParams.getEarlyPaidAmount()), scheduleParams.getPeriodNumber() + 1, mc));
|
||||||
if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment()
|
if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment()
|
||||||
|
&& fixedEmiAmount != null
|
||||||
&& fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
&& fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
||||||
currentPeriodParams.setEmiAmountChanged(true);
|
currentPeriodParams.setEmiAmountChanged(true);
|
||||||
|
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
||||||
}
|
}
|
||||||
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user