Vault Nullpointer

Discussion in 'Plugin Development' started by DogeDebugger, Mar 27, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    DogeDebugger

    Im getting a nullpointer:

    Code:
        EconomyResponse loan1 = econ.withdrawPlayer(player.getName(), loaned);
                        EconomyResponse loan2 = econ.depositPlayer(target.getName(), loaned);
    
                        if(!(isLoaning(player))) {
                            if(loan1.transactionSuccess() && loan2.transactionSuccess()) {
                                target.sendMessage(ChatColor.GOLD
                                        + "You were loaned $"
                                        + loaned
                                        + " by "
                                        + player.getName()
                                        + ". If you do not want to be in this loan, just pay them back. You have "
                                        + time + " minutes to pay it back using /loanback.");
    
    Error:
    Code:
    Caused by: java.lang.NullPointerException
            at me.dogeritos.loan.Main.onCommand(Main.java:66) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8.jar:git-Bukkit-15e81cf]
    The line:
    Code:
        EconomyResponse loan1 = econ.withdrawPlayer(player.getName(), loaned);
    The funny thing is, it works on my localhost but not my hosted server. wat.
     
  2. Offline

    nverdier

    DogeDebugger likes this.
  3. @DogeDebugger More than likely, "loaned" is null. Like @nverdier said, try printing it out to the console.
     
    DogeDebugger likes this.
Thread Status:
Not open for further replies.

Share This Page