Aman-Mittal commented on code in PR #5813:
URL: https://github.com/apache/fineract/pull/5813#discussion_r3173295344


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/service/DelinquencyReadPlatformServiceImpl.java:
##########
@@ -173,7 +173,9 @@ public CollectionData calculateLoanCollectionData(final 
Long loanId) {
             // loans
             collectionData = 
loanDelinquencyDomainService.getOverdueCollectionData(loan, 
effectiveDelinquencyList);
             
collectionData.setAvailableDisbursementAmount(calculateAvailableDisbursementAmount(loan));
-            
collectionData.setAvailableDisbursementAmountWithOverApplied(calculateAvailableDisbursementAmountWithOverApplied(loan));
+            if (loan.getLoanProduct() != null) {
+                
collectionData.setAvailableDisbursementAmountWithOverApplied(calculateAvailableDisbursementAmountWithOverApplied(loan));

Review Comment:
   Based on Adam's review I have one more concern. If loan product is non 
nullable and giving NPE shouldn't we use fail fast approach in this? As you 
have applied the npe handling in calculation wouldn't it cause logical issues? 
Even through all tests are passing. 



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