From 5560ab42940a50178a4588937f3b5cae7874e37f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 3 Nov 2011 20:42:34 +0000 Subject: Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update. --- EssentialsGroupManager/src/Changelog.txt | 2 +- .../anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'EssentialsGroupManager') diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index a8e7a772a..5262c7018 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -69,4 +69,4 @@ v 1.5: If the files have been altered (on disc) it will reload, so long as the in-memory data hasn't changed. If the files on Disc have changed AND there have been changes to it's in-memory data it will show a warning. You then MUST issue a '/mansave force' to overwrite the disc files, or a '/manload' to overwrite the memory data. - - Fix for an error in checkFullUserPermission caused by silly requests for a null perm. \ No newline at end of file + - Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 3546c757e..e8911b4a8 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -658,7 +658,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { if (result.resultType.equals(PermissionCheckResult.Type.EXCEPTION) || result.resultType.equals(PermissionCheckResult.Type.FOUND)) { return true; } - if (Bukkit.getPlayer(user.getName()).hasPermission(permission)) + if ((Bukkit.getPlayer(user.getName()) != null) && (Bukkit.getPlayer(user.getName()).hasPermission(permission))) return true; return false; @@ -700,7 +700,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { } } - if (Bukkit.getPlayer(user.getName()).hasPermission(targetPermission)) { + if ((Bukkit.getPlayer(user.getName()) != null) && (Bukkit.getPlayer(user.getName()).hasPermission(targetPermission))) { result.resultType = PermissionCheckResult.Type.FOUND; result.owner = user; return result; -- cgit v1.2.3