API User#setPrimaryGroup should care about stored value only (#3008)

This commit is contained in:
Luck 2021-05-03 23:10:57 +01:00
parent 71896a75bf
commit 528d668bc6
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -79,7 +79,7 @@ public class ApiUser extends ApiPermissionHolder implements net.luckperms.api.mo
@Override
public @NonNull DataMutateResult setPrimaryGroup(@NonNull String group) {
Objects.requireNonNull(group, "group");
if (getPrimaryGroup().equalsIgnoreCase(group)) {
if (group.equalsIgnoreCase(this.handle.getPrimaryGroup().getStoredValue().orElse(null))) {
return DataMutateResult.FAIL_ALREADY_HAS;
}