Merge pull request #106

fix: arraylist index out of bounds
This commit is contained in:
Will FP 2021-12-12 11:17:40 +00:00 committed by GitHub
commit 5d18d8c391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,10 @@ public class CommandRandomenchant extends Subcommand {
if ((args.isEmpty() && sender instanceof Player) || !sender.hasPermission("ecoenchants.command.randomenchant.others")) {
player = (Player) sender;
} else {
} else if (!args.isEmpty()) {
player = Bukkit.getServer().getPlayer(args.get(0));
} else {
player = null;
}
if (player == null) {