mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-07 11:20:32 +01:00
Prevent NPE when teleporting to a world not made by MV.
This commit is contained in:
parent
21a3eeacc8
commit
d2c09b9d33
@ -191,6 +191,8 @@ public class MVPlayerListener implements Listener {
|
|||||||
teleporter, teleporterName, teleportee.getName()));
|
teleporter, teleporterName, teleportee.getName()));
|
||||||
MultiverseWorld fromWorld = this.worldManager.getMVWorld(event.getFrom().getWorld().getName());
|
MultiverseWorld fromWorld = this.worldManager.getMVWorld(event.getFrom().getWorld().getName());
|
||||||
MultiverseWorld toWorld = this.worldManager.getMVWorld(event.getTo().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())) {
|
if (event.getFrom().getWorld().equals(event.getTo().getWorld())) {
|
||||||
// The player is Teleporting to the same world.
|
// The player is Teleporting to the same world.
|
||||||
this.plugin.log(Level.FINER, String.format("Player '%s' is teleporting to the same world.",
|
this.plugin.log(Level.FINER, String.format("Player '%s' is teleporting to the same world.",
|
||||||
|
Loading…
Reference in New Issue
Block a user