Ignore null entries in Permission#children map on Bukkit/Nukkit (#2235)

This commit is contained in:
Luck 2020-04-28 13:54:23 +01:00
parent b17da055af
commit ad6a11819d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 8 additions and 0 deletions

View File

@ -176,6 +176,10 @@ public final class LuckPermsPermissionMap extends ForwardingMap<String, Permissi
// iterate through the current known children.
// the first time this method is called for a given permission, the children map will contain only the permission itself.
for (Map.Entry<String, Boolean> e : children.entrySet()) {
if (e == null || e.getKey() == null || e.getValue() == null) {
continue;
}
if (accumulator.containsKey(e.getKey())) {
continue; // Prevent infinite loops
}

View File

@ -176,6 +176,10 @@ public final class LuckPermsPermissionMap extends ForwardingMap<String, Permissi
// iterate through the current known children.
// the first time this method is called for a given permission, the children map will contain only the permission itself.
for (Map.Entry<String, Boolean> e : children.entrySet()) {
if (e == null || e.getKey() == null || e.getValue() == null) {
continue;
}
if (accumulator.containsKey(e.getKey())) {
continue; // Prevent infinite loops
}