diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-11-29 13:10:00 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-11-29 13:10:00 +0000 |
commit | 0c81a68c7ba128b465264ac37d33dc51fac71d62 (patch) | |
tree | 508831ba933323db3b82dd0b7c9e44788ef03073 | |
parent | a36b755248f9029cfa2f02f9514ea445f0d253f5 (diff) | |
download | Essentials-0c81a68c7ba128b465264ac37d33dc51fac71d62.tar Essentials-0c81a68c7ba128b465264ac37d33dc51fac71d62.tar.gz Essentials-0c81a68c7ba128b465264ac37d33dc51fac71d62.tar.lz Essentials-0c81a68c7ba128b465264ac37d33dc51fac71d62.tar.xz Essentials-0c81a68c7ba128b465264ac37d33dc51fac71d62.zip |
Handle a null handler (GM)
-rw-r--r-- | Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java index 8fd375eae..8c3cdf1e2 100644 --- a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java @@ -21,6 +21,10 @@ public class GroupManagerHandler implements IPermissionsHandler public String getGroup(final Player base) { final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return null; + } return handler.getGroup(base.getName()); } @@ -28,6 +32,10 @@ public class GroupManagerHandler implements IPermissionsHandler public List<String> getGroups(final Player base) { final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return null; + } return Arrays.asList(handler.getGroups(base.getName())); } @@ -35,6 +43,10 @@ public class GroupManagerHandler implements IPermissionsHandler public boolean canBuild(final Player base, final String group) { final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return false; + } return handler.canUserBuild(base.getName()); } @@ -42,6 +54,10 @@ public class GroupManagerHandler implements IPermissionsHandler public boolean inGroup(final Player base, final String group) { AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return false; + } return handler.inGroup(base.getName(), group); } @@ -49,6 +65,10 @@ public class GroupManagerHandler implements IPermissionsHandler public boolean hasPermission(final Player base, final String node) { AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return false; + } return handler.has(base, node); } @@ -56,6 +76,10 @@ public class GroupManagerHandler implements IPermissionsHandler public String getPrefix(final Player base) { AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return null; + } return handler.getUserPrefix(base.getName()); } @@ -63,6 +87,10 @@ public class GroupManagerHandler implements IPermissionsHandler public String getSuffix(final Player base) { AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + if (handler == null) + { + return null; + } return handler.getUserSuffix(base.getName()); } } |