Fix for an error in checkFullUserPermission caused by players

disconnecting mid perms update.
This commit is contained in:
ElgarL 2011-11-03 20:42:34 +00:00
parent 87ccd7bf46
commit 5560ab4294
2 changed files with 3 additions and 3 deletions

View file

@ -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.
- Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update.

View file

@ -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;