summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-04-05 21:06:48 +0100
committerElgarL <ElgarL@palmergames.com>2012-04-05 21:06:48 +0100
commitbd7af593e7e77df0d59f32cf5b3b7d4170682af3 (patch)
tree9a771b98df3d4e69b219975040c19a47fe6f5a5a
parentf7bc04bc347c088d35ee5a939c026f28b2ce0c19 (diff)
downloadEssentials-bd7af593e7e77df0d59f32cf5b3b7d4170682af3.tar
Essentials-bd7af593e7e77df0d59f32cf5b3b7d4170682af3.tar.gz
Essentials-bd7af593e7e77df0d59f32cf5b3b7d4170682af3.tar.lz
Essentials-bd7af593e7e77df0d59f32cf5b3b7d4170682af3.tar.xz
Essentials-bd7af593e7e77df0d59f32cf5b3b7d4170682af3.zip
Don't throw errors when attempting to remove permission attachments
(bukkit will have already removed it).
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java9
2 files changed, 10 insertions, 2 deletions
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);
}
}