Fix NPE during first join for LuckPerms contexts (#5364)

This commit is contained in:
Josh Roy 2023-05-26 19:29:37 -04:00 committed by GitHub
parent 8323b47e40
commit 52a4dd2c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -75,6 +75,14 @@ public class LuckPermsHandler extends ModernVaultHandler {
}
final User user = ess.getUsers().loadUncachedUser(target.getUniqueId());
// This will occur for first time players during join,
// None of our contexts would apply to that kind of person anyway,
// lets just skip :O
if (user == null) {
return;
}
for (Calculator calculator : this.calculators) {
calculator.function.apply(user).forEach(value -> consumer.accept(calculator.id, value));
}