title: files.getPlayersConfig().contains() throws NullPointerException
body: <p>So I'm currently working a Bukkit (Technically Spigot plugin), and I want it to make a string in a file (players.yml) when a player joins for  the first time.</p>
  
  <p>I currently have: </p>
  
  <pre><code>public void onPlayerJoin(PlayerJoinEvent e){
      String player = e.getPlayer().getName().toString();
  
      if(!files.getPlayersConfig().contains(player)) {
          files.getPlayersConfig().set(player + ".enabled", true);
          files.getPlayersConfig().set(player + ".money", 100);
          files.savePlayersConfig();
          files.reloadPlayersConfig();
      }
  }
  </code></pre>
  
  <p>What I'm basically trying to do is to create a string "player" in a file for each player the first time they join. </p>
  
  <p>For example, if a player name bob joined for the first time, the file will generate</p>
  
  <pre><code>bob:
      enabled: true
      money: 100
  </code></pre>
  
  <p>However, I don't want it to reset every time the player joins, so that's why I'm trying to make it check if the file contains "bob", and if it returns null, it will create it. My problem is that it's showing up as an error instead of just creating it so it's not null.</p>
  
  <p>(Sorry for the bad wording but it's kinda hard to explain.)</p>
  
  <p>Thanks.</p>
  
  <p>Log:</p>
  
  <pre><code>PlayerJoinEvent to McEconPlus v1.0
  org.bukkit.event.EventException
      at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.PlayerList.onPlayerJoin(PlayerList.java:262) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.PlayerList.a(PlayerList.java:147) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.LoginListener.b(LoginListener.java:109) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.LoginListener.c(LoginListener.java:41) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.NetworkManager.a(NetworkManager.java:159) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.ServerConnection.c(ServerConnection.java:82) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:785) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:623) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:526) [spigot.jar:git-Spigot-8dc4297-fbda3a7]
      at java.lang.Thread.run(Unknown Source) [?:1.7.0_67]
  **Caused by: java.lang.NullPointerException**
      at me.mrson.McEconPlus.Events.MCEP_CreatePlayers.onPlayerJoin(MCEP_CreatePlayers.java:21) ~[?:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_67]
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
      at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_67]
      at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-8dc4297-fbda3a7]
      ... 14 more
  </code></pre>
  
  <p>Main class as requested: </p>
  
  <p>public class MCEP_Base extends JavaPlugin{
      private static Plugin plugin;</p>
  
  <pre><code>public File configFile = new File(this.getDataFolder(), "config.yml");
  public FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);
  
  public File playersFile = new File(this.getDataFolder(), "players.yml");
  public FileConfiguration players = YamlConfiguration.loadConfiguration(playersFile);
  
  
  public void onEnable(){
      plugin = this;
  
      //config
  
      config.options().copyDefaults(true);
      config.addDefault("Enabled", "true");
      this.saveCustomConfig();
  
      players.options().copyDefaults(true);
      players.addDefault("Enabled", true);
      this.savePlayersConfig();
  
      //Logger
      this.getLogger().log(Level.FINEST, "[McEcon+] Enabling.");
  
      //Commands
      getCommand("econ").setExecutor(new MCEP_Econ());
      getCommand("pay").setExecutor(new MCEP_Pay());
      getCommand("sell").setExecutor(new MCEP_Sell());
  
      //Events
      registerEvents(this, new MCEP_CreatePlayers());
  
  
  }
  
  public void onDisable(){
      plugin = null;
  }
  
  public static void registerEvent(Plugin plugin, Listener... listeners){
      for(Listener listener : listeners){
          Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
      }
  }
  
  public static Plugin getPlugin() {
      return plugin;
  }
  
  public void saveCustomConfig(){
      try{
          config.save(configFile);
      }catch(IOException ex){
          ex.printStackTrace();
      }
  }
  
  public void savePlayersConfig(){
      try{
          players.save(playersFile);
      }catch(IOException ex){
          ex.printStackTrace();
      }
  }
  
  public FileConfiguration getCustomConfig(){
      if(config == null){
          saveCustomConfig();
      }
      return config;
  }
  
  public FileConfiguration getPlayersConfig() {
      if (players == null) {
          savePlayersConfig();
      }
      return players;
  }
  
  public void reloadCustomConfig(){
      if(configFile == null){
          configFile = new File(getDataFolder(), "config.yml");
      }
      config = YamlConfiguration.loadConfiguration(configFile);
      config.set("Enabled", true);
  }
  
  public void reloadPlayersConfig(){
      if(playersFile == null){
          playersFile = new File(getDataFolder(), "players.yml");
      }
      players = YamlConfiguration.loadConfiguration(playersFile);
      players.set("Enabled", true);
  }
  
  public static void registerEvents(org.bukkit.plugin.Plugin plugin, Listener... listeners) {
      for (Listener listener : listeners) {
          Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Along with my Listener class:</p>
  
  <p>public class MCEP_CreatePlayers implements Listener{
      MCEP_Base files;</p>
  
  <pre><code>@EventHandler()
  public void onPlayerJoin(PlayerJoinEvent e){
      String player = e.getPlayer().getName().toString();
      if(files == null){
          MCEP_Base.getPlugin().getLogger().warning("Test");
      }else if(files.getPlayersConfig() == null){
          MCEP_Base.getPlugin().getLogger().warning("Test1");
      }
      else if(!files.players.contains(player)) {
          files.getPlayersConfig().set(player + ".enabled", true);
          files.getPlayersConfig().set(player + ".money", 100);
          files.savePlayersConfig();
          files.reloadPlayersConfig();
      }
  }
  </code></pre>
  
  <p>}</p>