From 9cedb684d65a3a30584f968c7b571997c63891d3 Mon Sep 17 00:00:00 2001 From: Flibio Date: Thu, 24 Nov 2016 09:00:40 -0700 Subject: [PATCH] Add checks for loan module config options --- .../flibio/economylite/modules/loan/LoanModule.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/io/github/flibio/economylite/modules/loan/LoanModule.java b/src/main/java/io/github/flibio/economylite/modules/loan/LoanModule.java index a8cbcd1..3966862 100644 --- a/src/main/java/io/github/flibio/economylite/modules/loan/LoanModule.java +++ b/src/main/java/io/github/flibio/economylite/modules/loan/LoanModule.java @@ -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 {