From 3ccaf535efa1c0314c6968b484c839718023432d Mon Sep 17 00:00:00 2001 From: Yazawazi <47273265+Yazawazi@users.noreply.github.com> Date: Sat, 18 Jun 2022 05:23:57 +0900 Subject: [PATCH] 2nd null check --- src/main/java/emu/grasscutter/command/commands/BanCommand.java | 3 +++ .../java/emu/grasscutter/command/commands/UnBanCommand.java | 3 +++ 2 files changed, 6 insertions(+) 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);