Fix NPE from null primary group in Vault hook (#3103)

This commit is contained in:
Luck 2021-07-18 20:35:31 +01:00
parent cfb298f69b
commit 5a377e713e
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -254,6 +254,9 @@ public class LuckPermsVaultPermission extends AbstractVaultPermission {
QueryOptions queryOptions = getQueryOptions(uuid, world);
MetaCache metaData = user.getCachedData().getMetaData(queryOptions);
String value = metaData.getPrimaryGroup(MetaCheckEvent.Origin.THIRD_PARTY_API);
if (value == null) {
return null;
}
Group group = getGroup(value);
return group != null ? groupName(group) : value;