mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-01-16 05:11:37 +01:00
Add extra catch for null primary group in powerfulperms migration
This commit is contained in:
parent
0e581cbcf3
commit
94a4051d29
@ -264,11 +264,14 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
|||||||
user.setPermission(NodeFactory.makeSuffixNode(maxWeight, suffix).build());
|
user.setPermission(NodeFactory.makeSuffixNode(maxWeight, suffix).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
String primary = joinFuture(pm.getPlayerPrimaryGroup(uuid)).getName().toLowerCase();
|
Group primaryGroup = joinFuture(pm.getPlayerPrimaryGroup(uuid));
|
||||||
|
if (primaryGroup != null && primaryGroup.getName() != null) {
|
||||||
|
String primary = primaryGroup.getName().toLowerCase();
|
||||||
if (!primary.equals("default")) {
|
if (!primary.equals("default")) {
|
||||||
user.setPermission(NodeFactory.make("group." + primary));
|
user.setPermission(NodeFactory.make("group." + primary));
|
||||||
user.getPrimaryGroup().setStoredValue(primary);
|
user.getPrimaryGroup().setStoredValue(primary);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
plugin.getUserManager().cleanup(user);
|
plugin.getUserManager().cleanup(user);
|
||||||
plugin.getStorage().saveUser(user);
|
plugin.getStorage().saveUser(user);
|
||||||
|
Loading…
Reference in New Issue
Block a user