Fix track editor command for empty tracks (£2997)

This commit is contained in:
Luck 2021-04-22 20:32:43 +01:00
parent 8741e8259f
commit 1d465aa800
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -73,6 +73,11 @@ public class TrackEditor extends ChildCommand<Track> {
// remove groups which the sender doesn't have perms to view
groups.removeIf(holder -> ArgumentPermissions.checkViewPerms(plugin, sender, getPermission().get(), holder) || ArgumentPermissions.checkGroup(plugin, sender, holder, ImmutableContextSetImpl.EMPTY));
if (groups.isEmpty()) {
Message.EDITOR_NO_MATCH.send(sender);
return CommandResult.FAILURE;
}
// then collect users which are a member of any of those groups
// (users which are on the track)
List<PermissionHolder> users = new ArrayList<>();