Fix invalid home locations giving blank errors (#4240)

This commit is contained in:
Josh Roy 2021-06-17 15:28:07 -04:00 committed by GitHub
parent 780aadedf2
commit f08c176b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ public abstract class UserData extends PlayerExtension implements IConf {
return search;
}
public Location getHome(final String name) throws Exception {
public Location getHome(final String name) {
final String search = getHomeName(name);
final LazyLocation loc = holder.homes().get(search);
return loc != null ? loc.location() : null;

View File

@ -81,7 +81,7 @@ public class Commandhome extends EssentialsCommand {
} else {
showError(user.getBase(), new Exception(tl("noHomeSetPlayer")), commandLabel);
}
} else if (homes.isEmpty()) {
} else if (homes.isEmpty() || finalPlayer.getHome(homes.get(0)) == null) {
showError(user.getBase(), new Exception(tl("noHomeSetPlayer")), commandLabel);
} else if (homes.size() == 1 && finalPlayer.equals(user)) {
try {