Skip to content

Commit

Permalink
fix: add null check for bukkit world ref (#4443)
Browse files Browse the repository at this point in the history
  • Loading branch information
dordsor21 authored Jun 16, 2024
1 parent c4bd6b6 commit 670f5a8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private BukkitWorld(final org.bukkit.World world) {
public static @NonNull BukkitWorld of(final org.bukkit.World world) {
WeakReference<BukkitWorld> 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);
Expand Down

0 comments on commit 670f5a8

Please sign in to comment.