#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.adminNoNewNameGiven);
            return;
        }

        if (!GuildUtils.tagExists(args[0])) {
            sender.sendMessage(messages.generalNoGuildFound);
            return;
        }
        
        if (GuildUtils.nameExists(args[1])) {
            sender.sendMessage(messages.createNameExists);
            return;
        }

        Guild guild = GuildUtils.byTag(args[0]);
        Region region = RegionUtils.get(guild.getRegion());

        PluginConfig.DataType dataType = Settings.getConfig().dataType;
        Manager.getInstance().stop();
        
        if (dataType.flat) {
            Flat.getGuildFile(guild).delete();
            Flat.getRegionFile(region).delete();
        }
        
        if (dataType.mysql) {
            new DatabaseGuild(guild).delete();
            new DatabaseRegion(region).delete();
        }
        
        guild.setName(args[1]);
        region.setName(args[1]);
        
        Manager.getInstance().start();
        sender.sendMessage(messages.adminNameChanged.replace("{GUILD}", guild.getName()));
    } 
                            #location 24 
                            #vulnerability type NULL_DEREFERENCE
#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.adminNoNewNameGiven);
            return;
        }

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

        if (guild == null) {
            sender.sendMessage(messages.generalNoGuildFound);
            return;
        }
        
        if (GuildUtils.nameExists(args[1])) {
            sender.sendMessage(messages.createNameExists);
            return;
        }

        Manager.getInstance().stop();
        PluginConfig.DataType dataType = Settings.getConfig().dataType;
        Region region = RegionUtils.get(guild.getRegion());

        if (dataType.flat) {
            Flat.getGuildFile(guild).delete();
            Flat.getRegionFile(region).delete();
        }
        
        if (dataType.mysql) {
            new DatabaseGuild(guild).delete();
            new DatabaseRegion(region).delete();
        }
        
        guild.setName(args[1]);
        region.setName(args[1]);
        
        Manager.getInstance().start();
        sender.sendMessage(messages.adminNameChanged.replace("{GUILD}", guild.getName()));
    }