mirror of
https://github.com/Shimeo98/DiscordWhitelisterSpigot.git
synced 2024-11-28 13:45:18 +01:00
fix NullPointerException when trying to access config classes
This commit is contained in:
parent
bc2ea65a90
commit
b5901db6bf
@ -268,6 +268,12 @@ public class DiscordWhitelister extends JavaPlugin
|
||||
|
||||
public static void ConfigSetup()
|
||||
{
|
||||
mainConfig = new MainConfig();
|
||||
customPrefixConfig = new CustomPrefixConfig();
|
||||
customMessagesConfig = new CustomMessagesConfig();
|
||||
permissionsConfig = new PermissionsConfig();
|
||||
onWhitelistCommandsConfig = new OnWhitelistCommandsConfig();
|
||||
|
||||
// Run this first, as it creates the root folder if it does not exist
|
||||
mainConfig.ConfigSetup();
|
||||
customPrefixConfig.ConfigSetup();
|
||||
|
@ -11,7 +11,7 @@ import java.util.Collections;
|
||||
|
||||
// discord-whitelister.yml
|
||||
public class MainConfig extends Config {
|
||||
MainConfig() {
|
||||
public MainConfig() {
|
||||
fileName = "discord-whitelister.yml";
|
||||
file = new File(DiscordWhitelister.getPlugin().getDataFolder(), fileName);
|
||||
fileConfiguration = new YamlConfiguration();
|
||||
|
@ -8,7 +8,7 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class OnWhitelistCommandsConfig extends Config {
|
||||
OnWhitelistCommandsConfig() {
|
||||
public OnWhitelistCommandsConfig() {
|
||||
fileName = "on-whitelist-commands.yml";
|
||||
file = new File(DiscordWhitelister.getPlugin().getDataFolder(), fileName);
|
||||
fileConfiguration = new YamlConfiguration();
|
||||
|
Loading…
Reference in New Issue
Block a user