When I call this method it doesn't work in java
<p>When I call on the method "getName(companyName)" from the class Company, it doesn't send the user the name of the company from the yml, it just throws a lot of exceptions.  However, when i put in the code that the method "getName(companyName)" returns into the sender.sendMessage, it does send the user the name of the company.  Why is this?</p>

<p>Class where the method will be executed:</p>

<pre><code>package me.ben.Corporation.commands;

import me.ben.Corporation.Company;
import me.ben.Corporation.Config;
import me.ben.Corporation.Corporation;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class CorporationCommand implements CommandExecutor
{
    Config companiesFile = Corporation.plugin.companiesFile;
    Company company;

    public boolean onCommand(CommandSender sender, Command cmd, String     cmdLabel, String[] args)
    {
        companiesFile.reload();

        if (cmdLabel.equalsIgnoreCase("corporation"))
        {
            if (args[0].equalsIgnoreCase("test"))
            {
                sender.sendMessage(company.getName(args[1]));
            }
        }
        return false;
    }
}
</code></pre>

<p>Class where the method "getName(companyName)" is:</p>

<pre><code>package me.ben.Corporation;

public class Company
{
    Config companiesFile = Corporation.plugin.companiesFile;

    public String getName(String companyName)
    {
        companiesFile.reload();
        return companiesFile.getConfig().getString("companies." + companyName.toLowerCase() + ".name");
    }
}
</code></pre>

<p>The YAML File the plugin reads and writes:</p>

<pre><code>    companies:
      simpleco:
        assets:
          cash: {}
          property: {}
        directors: {}
        expenses: {}
        liabilities: {}
        name: SimpleCo
        revenue: {}
</code></pre>