Fix some /home errors with invalid data.

This commit is contained in:
KHobbits 2014-03-09 17:59:07 +00:00
parent 2ee590d85c
commit 8fecd44786
3 changed files with 10 additions and 2 deletions

View file

@ -405,7 +405,8 @@ public class EssentialsConf extends YamlConfiguration
public Location getLocation(final String path, final Server server) throws InvalidWorldException public Location getLocation(final String path, final Server server) throws InvalidWorldException
{ {
final String worldName = getString((path == null ? "" : path + ".") + "world"); final String worldString = (path == null ? "" : path + ".") + "world";
final String worldName = getString(worldString);
if (worldName == null || worldName.isEmpty()) if (worldName == null || worldName.isEmpty())
{ {
return null; return null;

View file

@ -142,6 +142,9 @@ public abstract class UserData extends PlayerExtension implements IConf
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
} }
catch (IndexOutOfBoundsException e)
{
}
} }
return search; return search;
} }

View file

@ -109,7 +109,11 @@ public class Commandhome extends EssentialsCommand
} }
private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception
{ {
if (home.length() < 1)
{
throw new NotEnoughArgumentsException();
}
final Location loc = player.getHome(home); final Location loc = player.getHome(home);
if (loc == null) if (loc == null)
{ {