Skip to content

Commit

Permalink
Fix NPE when there's no co-owners on an ownerCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Chew committed Sep 8, 2021
1 parent adde632 commit 840a98f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,12 @@ public List<CommandPrivilege> buildPrivileges(@Nullable CommandClient client)
// Add owner
privileges.add(CommandPrivilege.enableUser(client.getOwnerId()));
// Add co-owners
for (String user : client.getCoOwnerIds())
privileges.add(CommandPrivilege.enableUser(user));
if (client.getCoOwnerIds() != null)
for (String user : client.getCoOwnerIds())
privileges.add(CommandPrivilege.enableUser(user));
}

// can only have up to 10 privileges
if (privileges.size() > 10)
privileges = privileges.subList(0, 10);

Expand Down

0 comments on commit 840a98f

Please sign in to comment.