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()); user.setPermission(NodeFactory.makeSuffixNode(maxWeight, suffix).build());
} }
String primary = joinFuture(pm.getPlayerPrimaryGroup(uuid)).getName().toLowerCase(); Group primaryGroup = joinFuture(pm.getPlayerPrimaryGroup(uuid));
if (!primary.equals("default")) { if (primaryGroup != null && primaryGroup.getName() != null) {
user.setPermission(NodeFactory.make("group." + primary)); String primary = primaryGroup.getName().toLowerCase();
user.getPrimaryGroup().setStoredValue(primary); if (!primary.equals("default")) {
user.setPermission(NodeFactory.make("group." + primary));
user.getPrimaryGroup().setStoredValue(primary);
}
} }
plugin.getUserManager().cleanup(user); plugin.getUserManager().cleanup(user);