Don't throw errors when attempting to remove permission attachments

(bukkit will have already removed it).
This commit is contained in:
ElgarL 2012-04-05 21:06:48 +01:00
parent f7bc04bc34
commit bd7af593e7
2 changed files with 10 additions and 2 deletions

View File

@ -163,4 +163,5 @@ v 1.9:
- Prevent Null entries in group inheritance from throwing errors. - Prevent Null entries in group inheritance from throwing errors.
v 2.0: 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 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. - 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).

View File

@ -351,7 +351,14 @@ public class BukkitPermissions {
*/ */
private void removeAttachment(Player player) { private void removeAttachment(Player player) {
if (attachments.containsKey(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); attachments.remove(player);
} }
} }