mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 12:52:57 +08:00
2nd null check
This commit is contained in:
parent
aba4080b0e
commit
3ccaf535ef
@ -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 {
|
|||||||
|
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user