Add extra catch for null primary group in powerfulperms migration

This commit is contained in:
Luck 2017-10-30 20:03:59 +00:00
parent 0e581cbcf3
commit 94a4051d29
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -264,10 +264,13 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
user.setPermission(NodeFactory.makeSuffixNode(maxWeight, suffix).build());
}
String primary = joinFuture(pm.getPlayerPrimaryGroup(uuid)).getName().toLowerCase();
if (!primary.equals("default")) {
user.setPermission(NodeFactory.make("group." + primary));
user.getPrimaryGroup().setStoredValue(primary);
Group primaryGroup = joinFuture(pm.getPlayerPrimaryGroup(uuid));
if (primaryGroup != null && primaryGroup.getName() != null) {
String primary = primaryGroup.getName().toLowerCase();
if (!primary.equals("default")) {
user.setPermission(NodeFactory.make("group." + primary));
user.getPrimaryGroup().setStoredValue(primary);
}
}
plugin.getUserManager().cleanup(user);