Archived
0

fix: return null if reference is null

This commit is contained in:
Forwolk
2018-08-04 16:17:31 +03:00
parent 72989c60b7
commit aa001b5fe2
3 changed files with 3 additions and 3 deletions

View File

@@ -99,7 +99,7 @@ public class Location implements Serializable{
public World getWorld () { public World getWorld () {
if (world == null) { if (world == null) {
throw new IllegalStateException("World is not initialized"); return null;
} }
if (world.get() == null) { if (world.get() == null) {
throw new ResourceUnloadedException("You're trying to get unloaded world"); throw new ResourceUnloadedException("You're trying to get unloaded world");

View File

@@ -112,7 +112,7 @@ public class ChunkImpl implements Chunk{
@Override @Override
public Region getRegion() { public Region getRegion() {
if (region == null) { if (region == null) {
throw new IllegalStateException("Region is not initialized"); return null;
} }
if (region.get() == null) { if (region.get() == null) {
throw new ResourceUnloadedException("Region is unloaded"); throw new ResourceUnloadedException("Region is unloaded");

View File

@@ -81,7 +81,7 @@ public class RegionImpl implements Region{
@Override @Override
public World getWorld() { public World getWorld() {
if (world == null) { if (world == null) {
throw new IllegalStateException("World is not initialized"); return null;
} }
if (world.get() == null) { if (world.get() == null) {
throw new ResourceUnloadedException("World is unloaded"); throw new ResourceUnloadedException("World is unloaded");