Fix logout npe

This commit is contained in:
Xephi 2014-06-14 23:25:47 +02:00
parent 4de55d9efa
commit f6791c35ec

View File

@ -74,9 +74,7 @@ public class LogoutCommand implements CommandExecutor {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, spawnLoc);
plugin.getServer().getPluginManager().callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
}
if (tpEvent.getTo() != null)
player.teleport(tpEvent.getTo());
}
}