mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 03:57:36 +01:00
More helpful error message when user is null in API PlayerAdapter (#3104)
This commit is contained in:
parent
5a377e713e
commit
5ea2aee2f4
@ -57,7 +57,9 @@ public class ApiPlayerAdapter<S, P extends S> implements PlayerAdapter<P> {
|
||||
public @NonNull User getUser(@NonNull P player) {
|
||||
Objects.requireNonNull(player, "player");
|
||||
me.lucko.luckperms.common.model.User user = this.userManager.getIfLoaded(this.contextManager.getUniqueId(checkType(player)));
|
||||
Objects.requireNonNull(user, "user");
|
||||
if (user == null) {
|
||||
throw new IllegalStateException("Unable to get a user for " + player);
|
||||
}
|
||||
return user.getApiProxy();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user