fix(api): Fixed NPE in AuthMeVelocityAPI#removePlayerIf

This commit is contained in:
Adrian 2023-04-21 23:10:58 -05:00
parent d617995bbe
commit e4716b44cc
No known key found for this signature in database
GPG Key ID: FB8EF84DCE1BE452
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public interface AuthMeVelocityAPI {
* Removes players who meet the established condition * Removes players who meet the established condition
* @param predicate the condition * @param predicate the condition
*/ */
void removePlayerIf(@NotNull Predicate<Player> predicate); void removePlayerIf(@NotNull Predicate<@NotNull Player> predicate);
/** /**
* Check if the player is on a login server * Check if the player is on a login server

View File

@ -186,7 +186,7 @@ public final class AuthMeVelocityPlugin implements AuthMeVelocityAPI {
@Override @Override
public void removePlayerIf(@NotNull Predicate<Player> predicate){ public void removePlayerIf(@NotNull Predicate<Player> predicate){
loggedPlayers.removeIf(uuid -> predicate.test(proxy.getPlayer(uuid).orElse(null))); loggedPlayers.removeIf(uuid -> proxy.getPlayer(uuid).filter(predicate).isPresent());
} }
@Override @Override