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); AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, spawnLoc);
plugin.getServer().getPluginManager().callEvent(tpEvent); plugin.getServer().getPluginManager().callEvent(tpEvent);
if(!tpEvent.isCancelled()) { if(!tpEvent.isCancelled()) {
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) { if (tpEvent.getTo() != null)
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
}
player.teleport(tpEvent.getTo()); player.teleport(tpEvent.getTo());
} }
} }