#vulnerable code 
                                public void load() {
        configuration = Configuration.load("core.yml");
        registerCoreModules();

        // check for upgrade before everything else
        new ConfigPost300().run();
        plugin.loadDatabase();

        Statistics.init();

        physicalDatabase = new PhysDB();
        databaseThread = new DatabaseThread(this);

        // Permissions init
        permissions = new NoPermissions();

        if(permissions.getClass() == NoPermissions.class) {
            if (resolvePlugin("PermissionsBukkit") != null) {
                permissions = new BukkitPermissions();
            } else if (resolvePlugin("PermissionsEx") != null) {
                permissions = new PEXPermissions();
            } else if (resolvePlugin("bPermissions") != null) {
                permissions = new bPermissions();
            } else {
                try {
                    Method method = CraftHumanEntity.class.getDeclaredMethod("hasPermission", String.class);
                    if (method != null) {
                        permissions = new SuperPermsPermissions();
                    }
                } catch(NoSuchMethodException e) {
                    // server does not support SuperPerms
                }
            }
        }

        // Currency init
        currency = new NoCurrency();

        if (resolvePlugin("iConomy") != null) {
            // We need to figure out which iConomy plugin we have...
            Plugin plugin = resolvePlugin("iConomy");

            // get the class name
            String className = plugin.getClass().getName();

            // check for the iConomy5 package
            try {
                if (className.startsWith("com.iConomy")) {
                    currency = new iConomy5Currency();
                } else {
                    // iConomy 6!
                    currency = new iConomy6Currency();
                }
            } catch (NoClassDefFoundError e) {
            }
        } else if (resolvePlugin("BOSEconomy") != null) {
            currency = new BOSECurrency();
        } else if (resolvePlugin("Essentials") != null) {
            currency = new EssentialsCurrency();
        }

        log("Permissions API: " + Colors.Red + permissions.getClass().getSimpleName());
        log("Currency API: " + Colors.Red + currency.getClass().getSimpleName());

        log("Connecting to " + Database.DefaultType);
        try {
            physicalDatabase.connect();

            // We're connected, perform any necessary database changes
            log("Performing any necessary database updates");

            physicalDatabase.load();

            log("Using database: " + StringUtil.capitalizeFirstLetter(physicalDatabase.getConnection().getMetaData().getDriverVersion()));
        } catch (Exception e) {
            e.printStackTrace();
        }

        // check any major conversions
        new MySQLPost200().run();

        // precache protections
        physicalDatabase.precache();

        // We are now done loading!
        moduleLoader.loadAll();

        // Should we try metrics?
        if (!configuration.getBoolean("optional.optOut", false)) {
            try {
                Metrics metrics = new Metrics();

                // Create a line graph
                Metrics.Graph lineGraph = metrics.createGraph(plugin, Metrics.Graph.Type.Line, "Protections");

                // Add the total protections plotter
                lineGraph.addPlotter(new Metrics.Plotter("Total") {
                    @Override
                    public int getValue() {
                        return physicalDatabase.getProtectionCount();
                    }
                });

                // Create a pie graph for individual protections
                Metrics.Graph pieGraph = metrics.createGraph(plugin, Metrics.Graph.Type.Pie, "Protection percentages");

                for (final Protection.Type type : Protection.Type.values()) {
                    if (type == Protection.Type.RESERVED1 || type == Protection.Type.RESERVED2) {
                        continue;
                    }

                    // Create the plotter
                    Metrics.Plotter plotter = new Metrics.Plotter(StringUtil.capitalizeFirstLetter(type.toString()) + " Protections") {
                        @Override
                        public int getValue() {
                            return physicalDatabase.getProtectionCount(type);
                        }
                    };

                    // Add it to both graphs
                    lineGraph.addPlotter(plotter);
                    pieGraph.addPlotter(plotter);
                }

                metrics.beginMeasuringPlugin(plugin);
            } catch (IOException e) {
                log(e.getMessage());
            }
        }
    } 
                            #location 74 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public void load() {
        configuration = Configuration.load("core.yml");
        registerCoreModules();

        // check for upgrade before everything else
        new ConfigPost300().run();
        plugin.loadDatabase();

        Statistics.init();

        physicalDatabase = new PhysDB();
        databaseThread = new DatabaseThread(this);

        // Permissions init
        permissions = new SuperPermsPermissions();

        if (resolvePlugin("PermissionsBukkit") != null) {
            permissions = new BukkitPermissions();
        } else if (resolvePlugin("PermissionsEx") != null) {
            permissions = new PEXPermissions();
        } else if (resolvePlugin("bPermissions") != null) {
            permissions = new bPermissions();
        }

        // Currency init
        currency = new NoCurrency();

        if (resolvePlugin("iConomy") != null) {
            // We need to figure out which iConomy plugin we have...
            Plugin plugin = resolvePlugin("iConomy");

            // get the class name
            String className = plugin.getClass().getName();

            // check for the iConomy5 package
            try {
                if (className.startsWith("com.iConomy")) {
                    currency = new iConomy5Currency();
                } else {
                    // iConomy 6!
                    currency = new iConomy6Currency();
                }
            } catch (NoClassDefFoundError e) {
            }
        } else if (resolvePlugin("BOSEconomy") != null) {
            currency = new BOSECurrency();
        } else if (resolvePlugin("Essentials") != null) {
            currency = new EssentialsCurrency();
        }

        log("Permissions API: " + Colors.Red + permissions.getClass().getSimpleName());
        log("Currency API: " + Colors.Red + currency.getClass().getSimpleName());

        log("Connecting to " + Database.DefaultType);
        try {
            physicalDatabase.connect();

            // We're connected, perform any necessary database changes
            log("Performing any necessary database updates");

            physicalDatabase.load();

            log("Using database: " + StringUtil.capitalizeFirstLetter(physicalDatabase.getConnection().getMetaData().getDriverVersion()));
        } catch (Exception e) {
            e.printStackTrace();
        }

        // check any major conversions
        new MySQLPost200().run();

        // precache protections
        physicalDatabase.precache();

        // We are now done loading!
        moduleLoader.loadAll();

        // Should we try metrics?
        if (!configuration.getBoolean("optional.optOut", false)) {
            try {
                Metrics metrics = new Metrics();

                // Create a line graph
                Metrics.Graph lineGraph = metrics.createGraph(plugin, Metrics.Graph.Type.Line, "Protections");

                // Add the total protections plotter
                lineGraph.addPlotter(new Metrics.Plotter("Total") {
                    @Override
                    public int getValue() {
                        return physicalDatabase.getProtectionCount();
                    }
                });

                // Create a pie graph for individual protections
                Metrics.Graph pieGraph = metrics.createGraph(plugin, Metrics.Graph.Type.Pie, "Protection percentages");

                for (final Protection.Type type : Protection.Type.values()) {
                    if (type == Protection.Type.RESERVED1 || type == Protection.Type.RESERVED2) {
                        continue;
                    }

                    // Create the plotter
                    Metrics.Plotter plotter = new Metrics.Plotter(StringUtil.capitalizeFirstLetter(type.toString()) + " Protections") {
                        @Override
                        public int getValue() {
                            return physicalDatabase.getProtectionCount(type);
                        }
                    };

                    // Add it to both graphs
                    lineGraph.addPlotter(plotter);
                    pieGraph.addPlotter(plotter);
                }

                metrics.beginMeasuringPlugin(plugin);
            } catch (IOException e) {
                log(e.getMessage());
            }
        }
    }