AshharAhmadKhan commented on PR #5813:
URL: https://github.com/apache/fineract/pull/5813#issuecomment-4336643142

   Good work @mansi75 ! The core fixes on lines 146 and 163 are correct and 
address the two most visible crash surfaces.
   
   Two things worth addressing before merge:
   
   **1. Helper still has no null guard (line 202)**
   
   `calculateAvailableDisbursementAmountWithOverApplied` dereferences 
`loanProduct` without a null check. This matters because 
`LoanReadPlatformServiceImpl` calls it directly at lines 648 and 663 with no 
guard at either call site — verified on `develop`. Those two surfaces are still 
live crashes.
   
   Fix:
   \```java
   // before
   if (loanProduct.isAllowApprovedDisbursedAmountsOverApplied()) {
   // after
   if (loanProduct != null && 
loanProduct.isAllowApprovedDisbursedAmountsOverApplied()) {
   \```
   
   **2. Tests assert null but don't cover the helper directly**
   
   Asserting `getAvailableDisbursementAmountWithOverApplied()` is null only 
confirms the field was never set. Since the helper is a public interface method 
and callable independently, it needs direct coverage — null product path, flag 
false, and the percentage calculation path.


-- 
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]

Reply via email to