diff --git a/paper-api/src/main/java/org/bukkit/permissions/Permission.java b/paper-api/src/main/java/org/bukkit/permissions/Permission.java index 14ec7099dd..0184f47c7b 100644 --- a/paper-api/src/main/java/org/bukkit/permissions/Permission.java +++ b/paper-api/src/main/java/org/bukkit/permissions/Permission.java @@ -52,6 +52,7 @@ public class Permission { } public Permission(String name, String description, PermissionDefault defaultValue, Map children) { + Validate.notNull(name, "Name cannot be null"); this.name = name; this.description = (description == null) ? "" : description; diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index e51658df56..5a9e50dbc9 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -615,7 +615,7 @@ public final class SimplePluginManager implements PluginManager { } public void recalculatePermissionDefaults(Permission perm) { - if (permissions.containsValue(perm)) { + if (perm != null && permissions.containsKey(perm.getName().toLowerCase())) { defaultPerms.get(true).remove(perm); defaultPerms.get(false).remove(perm);