mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Fix offline player consumer returning null users (#5339)
This commit is contained in:
parent
069ebfcd5b
commit
7ebb6359e5
@ -30,11 +30,16 @@ public abstract class EssentialsLoopCommand extends EssentialsCommand {
|
||||
final UUID uuid = StringUtil.toUUID(searchTerm);
|
||||
if (uuid != null) {
|
||||
final User matchedUser = ess.getUser(uuid);
|
||||
if (matchedUser == null) {
|
||||
throw new PlayerNotFoundException();
|
||||
}
|
||||
userConsumer.accept(matchedUser);
|
||||
} else if (matchWildcards && searchTerm.contentEquals("**")) {
|
||||
for (final UUID u : ess.getUsers().getAllUserUUIDs()) {
|
||||
final User user = ess.getUsers().loadUncachedUser(u);
|
||||
userConsumer.accept(user);
|
||||
if (user != null) {
|
||||
userConsumer.accept(user);
|
||||
}
|
||||
}
|
||||
} else if (matchWildcards && searchTerm.contentEquals("*")) {
|
||||
final boolean skipHidden = sender.isPlayer() && !ess.getUser(sender.getPlayer()).canInteractVanished();
|
||||
|
Loading…
Reference in New Issue
Block a user