Fix NPE, and properly send possible permissions in BukkitUser

This commit is contained in:
Luck 2016-08-30 13:06:36 +01:00
parent c15727377b
commit ab00c41452
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 10 additions and 3 deletions

View File

@ -72,7 +72,14 @@ public class BukkitUser extends User {
} }
// Calculate the permissions that should be applied. This is done async, who cares about how long it takes or how often it's done. // Calculate the permissions that should be applied. This is done async, who cares about how long it takes or how often it's done.
Map<String, Boolean> toApply = getLocalPermissions(getPlugin().getConfiguration().getServer(), plugin.getUserManager().getWorldCache().get(getUuid()), null); Map<String, Boolean> toApply = exportNodes(
getPlugin().getConfiguration().getServer(),
plugin.getUserManager().getWorldCache().get(getUuid()),
null,
plugin.getConfiguration().getIncludeGlobalPerms(),
true,
plugin.getPossiblePermissions()
);
try { try {
// The map in the LP PermissionAttachment is a ConcurrentHashMap. We can modify it's contents async. // The map in the LP PermissionAttachment is a ConcurrentHashMap. We can modify it's contents async.

View File

@ -228,8 +228,8 @@ public abstract class PermissionHolder {
Map<String, Boolean> perms = new HashMap<>(); Map<String, Boolean> perms = new HashMap<>();
for (Node node : getAllNodesFiltered(server, world, extraContext, includeGlobal, applyGroups)) { for (Node node : getAllNodesFiltered(server, world, extraContext, includeGlobal, applyGroups)) {
if (plugin.getConfiguration().getApplyWildcards()) { if (node.getPermission().equals("*") || node.getPermission().equals("'*'")) {
if (node.getPermission().equals("*") || node.getPermission().equals("'*'")) { if (possibleNodes != null && plugin.getConfiguration().getApplyWildcards()) {
possibleNodes.forEach(n -> perms.put(n, true)); possibleNodes.forEach(n -> perms.put(n, true));
continue; continue;
} }