Fix NPE in UserData#getHome (#4234)

This commit is contained in:
Josh Roy 2021-06-14 07:28:42 -04:00 committed by GitHub
parent c43af5d3d9
commit 3fe279e229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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