From bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 13 May 2011 09:18:25 +0000 Subject: Fix player kick if home is not set on respawn. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1427 e251c2fe-e539-e718-e476-b85c1f46cddb --- .../earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'EssentialsSpawn') diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 1ec1ffcaa..1531f4220 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -5,6 +5,7 @@ import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import java.util.logging.Level; import java.util.logging.Logger; +import org.bukkit.Location; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerRespawnEvent; @@ -21,7 +22,11 @@ public class EssentialsSpawnPlayerListener extends PlayerListener { if (Essentials.getStatic().getSettings().getRespawnAtHome()) { - event.setRespawnLocation(user.getHome()); + Location home = user.getHome(); + if (home == null) { + throw new Exception(); + } + event.setRespawnLocation(home); return; } } -- cgit v1.2.3