From 9b478fbef6cc743ce041dd462d037b1bb48fdf7f Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 30 Dec 2018 14:49:04 -0800 Subject: [PATCH] Fixed NPE in IslandManager on startup --- .../bentobox/bentobox/managers/IslandWorldManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java index 14c81f30e..f21099781 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java @@ -155,7 +155,11 @@ public class IslandWorldManager { * @return world settings, or null if world is unknown */ public WorldSettings getWorldSettings(World world) { - return gameModes.get(Util.getWorld(world)).getWorldSettings(); + if (gameModes.containsKey(Util.getWorld(world))) { + return gameModes.get(Util.getWorld(world)).getWorldSettings(); + } else { + return null; + } } /**