Merge pull request #691 from heisan213/patch-1

Prevent NPE when teleporting to a world not made by MV.
This commit is contained in:
main() 2012-05-22 11:14:30 -07:00
commit ee82dc213f

View File

@ -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.",