#fixed code
                                @Override
    public void execute(CommandSender sender, String[] args) {
        MessagesConfig messages = Messages.getInstance();

        if (args.length < 1) {
            sender.sendMessage(messages.generalNoTagGiven);
            return;
        } else if (args.length < 2) {
            sender.sendMessage(messages.adminNoBanTimeGiven);
            return;
        } else if (args.length < 3) {
            sender.sendMessage(messages.adminNoReasonGiven);
            return;
        }

        Guild guild = GuildUtils.get(args[0]);

        if (guild == null) {
            sender.sendMessage(messages.generalNoGuildFound);
            return;
        } 
        
        if (guild.isBanned()) {
            sender.sendMessage(messages.adminGuildBanned);
            return;
        }

        long time = Parser.parseTime(args[1]);

        if (time < 1) {
            sender.sendMessage(messages.adminTimeError);
            return;
        }

        StringBuilder reasonBuilder = new StringBuilder();

        for (int i = 2; i < args.length; i++) {
            reasonBuilder.append(args[i]);
            reasonBuilder.append(" ");
        }
        
        String reason = reasonBuilder.toString();
        BanUtils.ban(guild, time, reason);

        MessageTranslator translator = new MessageTranslator()
                .register("{GUILD", guild.getName())
                .register("{TAG}", guild.getTag())
                .register("{TIME}", args[1])
                .register("{REASON}", StringUtils.colored(reason));

        sender.sendMessage(translator.translate(messages.adminGuildBan));
        Bukkit.broadcastMessage(translator.translate(messages.broadcastBan));
    }
#vulnerable code 
                                @Override
    public void execute(CommandSender sender, String[] args) {
        MessagesConfig messages = Messages.getInstance();

        if (args.length < 1) {
            sender.sendMessage(messages.generalNoTagGiven);
            return;
        } else if (args.length < 2) {
            sender.sendMessage(messages.adminNoBanTimeGiven);
            return;
        } else if (args.length < 3) {
            sender.sendMessage(messages.adminNoReasonGiven);
            return;
        }

        if (!GuildUtils.tagExists(args[0])) {
            sender.sendMessage(messages.generalNoGuildFound);
            return;
        } 
        
        Guild guild = GuildUtils.byTag(args[0]);
        if (guild.isBanned()) {
            sender.sendMessage(messages.adminGuildBanned);
            return;
        }

        long time = Parser.parseTime(args[1]);
        if (time < 1) {
            sender.sendMessage(messages.adminTimeError);
            return;
        }

        StringBuilder sb = new StringBuilder();
        for (int i = 2; i < args.length; i++) {
            sb.append(args[i]);
            sb.append(" ");
        }
        
        String reason = sb.toString();
        
        BanUtils.ban(guild, time, reason);
        sender.sendMessage(messages.adminGuildBan.replace("{GUILD}", guild.getName()).replace("{TIME}", args[1]));
        Bukkit.broadcastMessage(Messages.getInstance().broadcastBan.replace("{GUILD}", guild.getName())
                        .replace("{TAG}", guild.getTag()).replace("{REASON}", StringUtils.colored(reason)).replace("{TIME}", args[1]));
    } 
                            #location 22 
                            #vulnerability type NULL_DEREFERENCE