Fix sethome/seen for invalid players.

This commit is contained in:
KHobbits 2011-08-11 03:33:45 +01:00
parent 1fbed62c1d
commit 300ee9c729
2 changed files with 5 additions and 1 deletions

View file

@ -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())));
}

View file

@ -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"));
}
}