airajena commented on code in PR #5282:
URL: https://github.com/apache/fineract/pull/5282#discussion_r2682261304
##########
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsHelper.java:
##########
@@ -52,6 +52,11 @@ public List<LocalDateInterval>
determineInterestPostingPeriods(final LocalDate s
final Integer financialYearBeginningMonth, List<LocalDate>
postInterestAsOn) {
final List<LocalDateInterval> postingPeriods = new ArrayList<>();
+
+ if (startInterestCalculationLocalDate == null ||
interestPostingUpToDate == null) {
Review Comment:
The null check prevents a NullPointerException that occurs when either
startInterestCalculationLocalDate or interestPostingUpToDate is null.
DateUtils.isAfter() at line 64 throws NPE when comparing null dates, This
happens when closing a Fixed Deposit account where depositPeriodFrequencyType
is INVALID, causing the maturity date (and subsequently
interestPostingUpToDate) to be null
If either date is null, there are no valid interest posting periods to
determine
- An empty list semantically means "no posting periods" - which is accurate
when dates are undefined
- This allows the calling code (e.g., account closure) to continue gracefully
I've also rebased the PR with the latest develop branch as requested.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]