Skip to content

Commit

Permalink
Null check missing world
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 30, 2021
1 parent 840f324 commit 57adea4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main/src/main/java/net/citizensnpcs/util/ChunkCoord.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;

public class ChunkCoord {
public final UUID worldUUID;
Expand Down Expand Up @@ -45,7 +46,8 @@ public boolean equals(Object obj) {
}

public Chunk getChunk() {
return Bukkit.getWorld(worldUUID).getChunkAt(x, z);
World world = Bukkit.getWorld(worldUUID);
return world != null ? world.getChunkAt(x, z) : null;
}

@Override
Expand Down

0 comments on commit 57adea4

Please sign in to comment.