From 211e6a0fcb3a5cb8bde21b9a5ba429874883b0c9 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Wed, 27 Mar 2024 19:32:44 +0100 Subject: [PATCH] fix: Fix NullPointerException when using portals --- .../java/com/craftaro/skyblock/island/IslandManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/craftaro/skyblock/island/IslandManager.java b/src/main/java/com/craftaro/skyblock/island/IslandManager.java index 9348830b..64afc526 100644 --- a/src/main/java/com/craftaro/skyblock/island/IslandManager.java +++ b/src/main/java/com/craftaro/skyblock/island/IslandManager.java @@ -1509,9 +1509,10 @@ public class IslandManager { Bukkit.getScheduler().runTask(this.plugin, () -> { if (configLoad.getBoolean("Island.WorldBorder.Enable") && island.isBorder()) { - SWorldBorder.send(player, island.getBorderColor(), island.getSize(), - island.getLocation(worldManager.getIslandWorld(player.getWorld()), - IslandEnvironment.ISLAND).clone().add(increment, 0, increment)); + Location islandLocation = island.getLocation(worldManager.getIslandWorld(player.getWorld()), IslandEnvironment.ISLAND); + if (islandLocation != null) { + SWorldBorder.send(player, island.getBorderColor(), island.getSize(), islandLocation.clone().add(increment, 0, increment)); + } } else { SWorldBorder.send(player, null, 1.4999992E7D, new org.bukkit.Location(player.getWorld(), 0, 0, 0)); }