Browse Source

inserted nullcheck for player

linus 6 years ago
parent
commit
597bcdcc64
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/xyz/spaceio/customoregen/CustomOreGen.java

+ 5 - 1
src/xyz/spaceio/customoregen/CustomOreGen.java

@@ -99,8 +99,9 @@ public class CustomOreGen extends JavaPlugin {
 
 
 		cachedOregenJsonConfig = new JSONConfig(cachedOregenConfigs, new TypeToken<HashMap<UUID, Integer>>() {
 		cachedOregenJsonConfig = new JSONConfig(cachedOregenConfigs, new TypeToken<HashMap<UUID, Integer>>() {
 		}.getType(), this);
 		}.getType(), this);
+
 		cachedOregenConfigs = (HashMap<UUID, Integer>) cachedOregenJsonConfig.get();
 		cachedOregenConfigs = (HashMap<UUID, Integer>) cachedOregenJsonConfig.get();
-		
+
 		if (cachedOregenConfigs == null) {
 		if (cachedOregenConfigs == null) {
 			cachedOregenConfigs = new HashMap<UUID, Integer>();
 			cachedOregenConfigs = new HashMap<UUID, Integer>();
 		}
 		}
@@ -143,6 +144,9 @@ public class CustomOreGen extends JavaPlugin {
 	}
 	}
 
 
 	public OfflinePlayer getOwner(Location loc) {
 	public OfflinePlayer getOwner(Location loc) {
+		if (skyblockAPI.getIslandOwner(loc) == null) {
+			return null;
+		}
 		UUID uuid = skyblockAPI.getIslandOwner(loc);
 		UUID uuid = skyblockAPI.getIslandOwner(loc);
 		if (uuid == null) {
 		if (uuid == null) {
 			return null;
 			return null;