Skip to content
Snippets Groups Projects
Commit 3ccaf535 authored by Yazawazi's avatar Yazawazi Committed by Melledy
Browse files

2nd null check

parent aba4080b
Branches
Tags
No related merge requests found
...@@ -29,6 +29,9 @@ public final class BanCommand implements CommandHandler { ...@@ -29,6 +29,9 @@ public final class BanCommand implements CommandHandler {
Account account = player.getAccount(); Account account = player.getAccount();
if (account == null) { if (account == null) {
account = DatabaseHelper.getAccountByPlayerId(uid); account = DatabaseHelper.getAccountByPlayerId(uid);
if (account == null) {
return false;
}
} }
account.setBanReason(reason); account.setBanReason(reason);
......
...@@ -30,6 +30,9 @@ public final class UnBanCommand implements CommandHandler { ...@@ -30,6 +30,9 @@ public final class UnBanCommand implements CommandHandler {
if (account == null) { if (account == null) {
account = DatabaseHelper.getAccountByPlayerId(uid); account = DatabaseHelper.getAccountByPlayerId(uid);
if (account == null) {
return false;
}
} }
account.setBanReason(null); account.setBanReason(null);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment