From d2c09b9d336833285c8453f16d1643d12f18194f Mon Sep 17 00:00:00 2001 From: heisan213 Date: Tue, 22 May 2012 19:25:32 +0300 Subject: [PATCH] Prevent NPE when teleporting to a world not made by MV. --- .../onarandombox/MultiverseCore/listeners/MVPlayerListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 89f50ad7..51f70553 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -191,6 +191,8 @@ public class MVPlayerListener implements Listener { teleporter, teleporterName, teleportee.getName())); MultiverseWorld fromWorld = this.worldManager.getMVWorld(event.getFrom().getWorld().getName()); MultiverseWorld toWorld = this.worldManager.getMVWorld(event.getTo().getWorld().getName()); + if (fromWorld == null || toWorld == null) + return; if (event.getFrom().getWorld().equals(event.getTo().getWorld())) { // The player is Teleporting to the same world. this.plugin.log(Level.FINER, String.format("Player '%s' is teleporting to the same world.",