From 670f5a802e851a5c148b4f086fbe96b5575a26c0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 16 Jun 2024 10:53:50 +0200 Subject: [PATCH] fix: add null check for bukkit world ref (#4443) --- .../src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java index 4858036d7..7918d4815 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java @@ -75,7 +75,7 @@ public class BukkitWorld implements World { public static @NonNull BukkitWorld of(final org.bukkit.World world) { WeakReference bukkitWorldRef = worldMap.get(world.getName()); BukkitWorld bukkitWorld; - if ((bukkitWorld = bukkitWorldRef.get()) != null && world.equals(bukkitWorld.world.get())) { + if (bukkitWorldRef != null && (bukkitWorld = bukkitWorldRef.get()) != null && world.equals(bukkitWorld.world.get())) { return bukkitWorld; } bukkitWorld = new BukkitWorld(world);