Skip to content

Commit 18233d3

Browse files
authored
Fix NPE in PermissionsHandler#getGroups(OfflinePlayer) (#6398)
1 parent 5ed1d1e commit 18233d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Essentials/src/main/java/com/earth2me/essentials/perm/PermissionsHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public List<String> getGroups(final OfflinePlayer base) {
5252
final long start = System.nanoTime();
5353
final List<String> groups = new ArrayList<>();
5454
groups.add(defaultGroup);
55-
groups.addAll(handler.getGroups(base));
55+
final List<String> handlerGroups = handler.getGroups(base);
56+
if (handlerGroups != null && !handlerGroups.isEmpty()) {
57+
groups.addAll(handlerGroups);
58+
}
5659
checkPermLag(start, String.format("Getting groups for %s", base.getName()));
5760
return Collections.unmodifiableList(groups);
5861
}

0 commit comments

Comments
 (0)