From 3a43c40634046e5caead1e2796dc22e33ad435cb Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 3 Oct 2021 16:16:58 -0700 Subject: [PATCH] Ensure oldIsland is never null. --- .../api/commands/island/team/IslandTeamKickCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamKickCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamKickCommand.java index 550c557a4..2aab070fa 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamKickCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamKickCommand.java @@ -83,7 +83,7 @@ public class IslandTeamKickCommand extends ConfirmableCommand { private void kick(User user, UUID targetUUID) { User target = User.getInstance(targetUUID); - Island oldIsland = getIslands().getIsland(getWorld(), targetUUID); + Island oldIsland = Objects.requireNonNull(getIslands().getIsland(getWorld(), targetUUID)); // Should never be null because of checks above // Fire event IslandBaseEvent event = TeamEvent.builder() .island(oldIsland)