fix: return null if reference is null
This commit is contained in:
@@ -112,7 +112,7 @@ public class ChunkImpl implements Chunk{
|
||||
@Override
|
||||
public Region getRegion() {
|
||||
if (region == null) {
|
||||
throw new IllegalStateException("Region is not initialized");
|
||||
return null;
|
||||
}
|
||||
if (region.get() == null) {
|
||||
throw new ResourceUnloadedException("Region is unloaded");
|
||||
|
||||
@@ -81,7 +81,7 @@ public class RegionImpl implements Region{
|
||||
@Override
|
||||
public World getWorld() {
|
||||
if (world == null) {
|
||||
throw new IllegalStateException("World is not initialized");
|
||||
return null;
|
||||
}
|
||||
if (world.get() == null) {
|
||||
throw new ResourceUnloadedException("World is unloaded");
|
||||
|
||||
Reference in New Issue
Block a user