diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-08-11 03:33:45 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-08-11 03:33:45 +0100 |
commit | 300ee9c72987e023e5faf0eccd01edd460c2af8c (patch) | |
tree | 4ddb5684247af9bd5a444ab855469de70b53a856 | |
parent | 1fbed62c1d5ce2a36da8b367929143cfad0fe0f0 (diff) | |
download | Essentials-300ee9c72987e023e5faf0eccd01edd460c2af8c.tar Essentials-300ee9c72987e023e5faf0eccd01edd460c2af8c.tar.gz Essentials-300ee9c72987e023e5faf0eccd01edd460c2af8c.tar.lz Essentials-300ee9c72987e023e5faf0eccd01edd460c2af8c.tar.xz Essentials-300ee9c72987e023e5faf0eccd01edd460c2af8c.zip |
Fix sethome/seen for invalid players.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandseen.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandsethome.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 6e87b116f..c355f5aff 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -30,7 +30,7 @@ public class Commandseen extends EssentialsCommand User u = ess.getOfflineUser(args[0]); if (u == null) { - return; + throw new Exception(Util.i18n("playerNotFound")); } sender.sendMessage(Util.format("seenOffline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogout()))); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index e07572f95..154017d43 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -30,6 +30,10 @@ public class Commandsethome extends EssentialsCommand { usersHome = ess.getOfflineUser(args[0]); } + if (usersHome == null) + { + throw new Exception(Util.i18n("playerNotFound")); + } usersHome.setHome(user.getLocation(), args[1].equalsIgnoreCase("default")); } } |