Skip to content

Commit

Permalink
Altered DepositCommand.java and WithdrawCommand.java
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Sep 20, 2021
1 parent bc1db19 commit a5e4dc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public boolean execute(CommandSender sender, String[] args) {
String amountString = singleQuoteArgs.get(1);
int amount = Integer.parseInt(amountString); // TODO: handle error here

if (amount < 0) {
player.sendMessage(ChatColor.RED + "Amount can't be negative.");
return false;
}

Currency currency = PersistentData.getInstance().getCurrency(currencyName);
if (currency == null) {
player.sendMessage(ChatColor.RED + "That currency wasn't found.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public boolean execute(CommandSender sender, String[] args) {
String amountString = singleQuoteArgs.get(1);
int amount = Integer.parseInt(amountString); // TODO: handle error here

if (amount < 0) {
player.sendMessage(ChatColor.RED + "Amount can't be negative.");
return false;
}

Currency currency = PersistentData.getInstance().getCurrency(currencyName);
if (currency == null) {
player.sendMessage(ChatColor.RED + "That currency wasn't found.");
Expand Down

0 comments on commit a5e4dc8

Please sign in to comment.