1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-13 01:54:25 +02:00

Fix some /home errors with invalid data.

This commit is contained in:
KHobbits
2014-03-09 17:59:07 +00:00
parent aba7ea5b02
commit 31718c2a05
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
{
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())
{
return null;

View File

@@ -142,6 +142,9 @@ public abstract class UserData extends PlayerExtension implements IConf
catch (NumberFormatException e)
{
}
catch (IndexOutOfBoundsException e)
{
}
}
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
{
{
if (home.length() < 1)
{
throw new NotEnoughArgumentsException();
}
final Location loc = player.getHome(home);
if (loc == null)
{