summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-06-14 18:20:49 +0100
committerKHobbits <rob@khobbits.co.uk>2014-06-14 18:20:49 +0100
commite1852795ea1db4a926a35a642ce9b142ef48bbfe (patch)
tree157bc36fe1c5dc4db66a00627877fb7caa63ef44
parent784d22bb114dddc0f7002fe7041a2d601c559bfc (diff)
downloadEssentials-e1852795ea1db4a926a35a642ce9b142ef48bbfe.tar
Essentials-e1852795ea1db4a926a35a642ce9b142ef48bbfe.tar.gz
Essentials-e1852795ea1db4a926a35a642ce9b142ef48bbfe.tar.lz
Essentials-e1852795ea1db4a926a35a642ce9b142ef48bbfe.tar.xz
Essentials-e1852795ea1db4a926a35a642ce9b142ef48bbfe.zip
Check for arraynull on pex group request.
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java
index 68dc3fe50..cb6d849aa 100644
--- a/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java
@@ -25,7 +25,14 @@ public class PermissionsExHandler extends SuperpermsHandler
{
return null;
}
- return user.getGroupsNames()[0];
+
+ String[] groupsNames = user.getGroupsNames();
+ if (groupsNames == null)
+ {
+ return null;
+ }
+
+ return groupsNames[0];
}
@Override
@@ -36,7 +43,14 @@ public class PermissionsExHandler extends SuperpermsHandler
{
return null;
}
- return Arrays.asList(user.getGroupsNames());
+
+ String[] groupsNames = user.getGroupsNames();
+ if (groupsNames == null)
+ {
+ return null;
+ }
+
+ return Arrays.asList(groupsNames);
}
@Override