mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-22 17:18:20 +01:00
Null check missing world
This commit is contained in:
parent
840f32469b
commit
57adea419a
@ -5,6 +5,7 @@ import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
|
||||
public class ChunkCoord {
|
||||
public final UUID worldUUID;
|
||||
@ -45,7 +46,8 @@ public class ChunkCoord {
|
||||
}
|
||||
|
||||
public Chunk getChunk() {
|
||||
return Bukkit.getWorld(worldUUID).getChunkAt(x, z);
|
||||
World world = Bukkit.getWorld(worldUUID);
|
||||
return world != null ? world.getChunkAt(x, z) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user