Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Add checks for loan module config options
Browse files Browse the repository at this point in the history
  • Loading branch information
Flibio committed Nov 24, 2016
1 parent 093b55e commit 9cedb68
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public boolean initialize(Logger logger, Object plugin) {
if (iOpt.isPresent() && mOpt.isPresent()) {
interestRate = iOpt.get();
maxLoan = mOpt.get();
if (interestRate < 1) {
logger.error("The interest rate must be greater than or equal to 1!");
return false;
}
if (maxLoan <= 0) {
logger.error("The interest rate must be greater than 0!");
return false;
}
logger.info("Interest rate set to " + interestRate + "!");
logger.info("Maximum loan balance set to " + maxLoan + "!");
} else {
Expand Down

0 comments on commit 9cedb68

Please sign in to comment.