diff --git a/src/main/java/emu/grasscutter/command/commands/BanCommand.java b/src/main/java/emu/grasscutter/command/commands/BanCommand.java index e353f398e..da3615b7d 100644 --- a/src/main/java/emu/grasscutter/command/commands/BanCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/BanCommand.java @@ -29,6 +29,9 @@ public final class BanCommand implements CommandHandler { Account account = player.getAccount(); if (account == null) { account = DatabaseHelper.getAccountByPlayerId(uid); + if (account == null) { + return false; + } } account.setBanReason(reason); diff --git a/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java b/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java index 40a14c5ae..0b3dc7d8d 100644 --- a/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java @@ -30,6 +30,9 @@ public final class UnBanCommand implements CommandHandler { if (account == null) { account = DatabaseHelper.getAccountByPlayerId(uid); + if (account == null) { + return false; + } } account.setBanReason(null);