From 350750bb1116e8b05daf33689af6c8e699d4430d Mon Sep 17 00:00:00 2001 From: OmerBenGera Date: Tue, 25 Jan 2022 23:27:38 +0200 Subject: [PATCH] Fixed invalid privileges in the permissions-menu throwing errors --- .../superiorskyblock/menu/impl/MenuIslandPrivileges.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bgsoftware/superiorskyblock/menu/impl/MenuIslandPrivileges.java b/src/main/java/com/bgsoftware/superiorskyblock/menu/impl/MenuIslandPrivileges.java index cd88c3422..210c762ba 100644 --- a/src/main/java/com/bgsoftware/superiorskyblock/menu/impl/MenuIslandPrivileges.java +++ b/src/main/java/com/bgsoftware/superiorskyblock/menu/impl/MenuIslandPrivileges.java @@ -98,7 +98,11 @@ public static void init() { for (String key : permissionsSection.getKeys(false)) { if (permissionsSection.getBoolean(key + ".display-menu", true)) { String permission = key.toLowerCase(); - updatePermission(IslandPrivilege.getByName(permission), cfg, position++); + try { + updatePermission(IslandPrivilege.getByName(permission), cfg, position++); + } catch (NullPointerException error) { + SuperiorSkyblockPlugin.log("&cThe island-privilege '" + permission + "' is not a valid privilege, skipping..."); + } } } }