Skip to content

Commit

Permalink
Fix error thrown when running commands from console with no server ac…
Browse files Browse the repository at this point in the history
…count.

Signed-off-by: creatorfromhell <[email protected]>
  • Loading branch information
creatorfromhell committed Aug 17, 2023
1 parent 0dcadd9 commit a9b2fe5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Core/src/net/tnemc/core/command/MoneyCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public static void onBalance(CmdSource<?> sender, Currency currency, String regi

//If our currency doesn't exist this is probably a username, so check for their balance instead.
final Optional<Account> account = sender.account();
if(account.isEmpty()) {
final MessageData data = new MessageData("Messages.General.NoPlayer");
data.addReplacement("$player", sender.name());
sender.message(data);
return;
}
account.ifPresent(value->onOther(sender, value, region, currency));
}

Expand Down

0 comments on commit a9b2fe5

Please sign in to comment.