percyashu commented on code in PR #2355:
URL: https://github.com/apache/fineract/pull/2355#discussion_r897131780


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -938,7 +938,7 @@ public CommandProcessingResult makeGLIMLoanRepayment(final 
Long loanId, final Js
 
         final Long parentLoanId = loanId;
 
-        glimRepository.findById(parentLoanId).get();
+        glimRepository.findById(parentLoanId).orElse(null);

Review Comment:
   I think instead of introducing null checks, we can directly throw an 
exception as shown below
   
   
`glimRepository.findById(parentLoanId).orElseThrow(NoSuchElementException::new);`
 



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