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(
|
scheduleParams.getTotalCumulativePrincipal().plus(
|
||||||
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.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
&& fixedEmiAmount != null
|
||||||
currentPeriodParams.setEmiAmountChanged(true);
|
&& fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
||||||
}
|
currentPeriodParams.setEmiAmountChanged(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
adjustCompoundedAmountWithPaidDetail(scheduleParams, lastRestDate, currentTransactions, loanApplicationTerms,
|
adjustCompoundedAmountWithPaidDetail(scheduleParams, lastRestDate, currentTransactions, loanApplicationTerms,
|
||||||
@@ -636,10 +637,12 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
|||||||
scheduleParams.getReducePrincipal(),
|
scheduleParams.getReducePrincipal(),
|
||||||
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.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
&& fixedEmiAmount != null
|
||||||
currentPeriodParams.setEmiAmountChanged(true);
|
&& fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount()) != 0) {
|
||||||
}
|
currentPeriodParams.setEmiAmountChanged(true);
|
||||||
|
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
||||||
|
}
|
||||||
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user