mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 13:15:28 +01:00
Null check
This commit is contained in:
parent
25fe86d812
commit
8eac5070f0
@ -41,12 +41,13 @@ public class AdminDeleteCommand extends ConfirmableCommand {
|
||||
user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0));
|
||||
return false;
|
||||
}
|
||||
if (!getIslands().hasIsland(getWorld(), targetUUID)) {
|
||||
UUID owner = getIslands().getOwner(getWorld(), targetUUID);
|
||||
if (owner == null) {
|
||||
user.sendMessage("general.errors.player-has-no-island");
|
||||
return false;
|
||||
}
|
||||
// Team members should be kicked before deleting otherwise the whole team will become weird
|
||||
if (getIslands().inTeam(getWorld(), targetUUID) && getIslands().getOwner(getWorld(), targetUUID).equals(targetUUID)) {
|
||||
if (getIslands().inTeam(getWorld(), targetUUID) && owner.equals(targetUUID)) {
|
||||
user.sendMessage("commands.admin.delete.cannot-delete-owner");
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user