From 18007c2367c6acdd3123c465bdcac0c7306b9e21 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 3 Jun 2024 07:38:14 +0200 Subject: [PATCH] fix: add null check for bukkit world ref --- .../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);