From bd7af593e7e77df0d59f32cf5b3b7d4170682af3 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 5 Apr 2012 21:06:48 +0100 Subject: Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../anjocaido/groupmanager/permissions/BukkitPermissions.java | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'EssentialsGroupManager') diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index c5fe5564d..2cfe57f62 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -163,4 +163,5 @@ v 1.9: - Prevent Null entries in group inheritance from throwing errors. v 2.0: - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. - - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. \ No newline at end of file + - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. + - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 5c711351e..6df18cb05 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -351,7 +351,14 @@ public class BukkitPermissions { */ private void removeAttachment(Player player) { if (attachments.containsKey(player)) { - player.removeAttachment(attachments.get(player)); + try { + player.removeAttachment(attachments.get(player)); + } catch (IllegalArgumentException e) { + /* + * Failed to remove attachment + * This usually means Bukkit no longer know of it. + */ + } attachments.remove(player); } } -- cgit v1.2.3