galovics commented on code in PR #2355:
URL: https://github.com/apache/fineract/pull/2355#discussion_r896465426
##########
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:
This is not gonna fly. This rather needs to be an existence check.
If you wanna keep it that way, extract the result it to a variable and do a
null-check to make sure the code fails in case the parent loan doesn't exist.
--
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]