Vault

Vault

7M Downloads

Cannot withdraw money

PedroAS7 opened this issue ยท 1 comments

commented

Hello everyone,
when I try to withdraw money from the players account, there is an error:

[19:37:01 WARN]: Unexpected exception while parsing console command "fat PeterAS
17 Tesla"
org.bukkit.command.CommandException: Unhandled exception executing command 'fat'
in plugin TicketsAndFines vR0.4 - BUILD 13
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[min
ecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:17
5) ~[minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServe
r.java:683) ~[minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchServerCommand(Craf
tServer.java:670) [minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.DedicatedServer.aw(DedicatedServer.java:
286) [minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:2
51) [minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:5
45) [minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java
:457) [minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:6
17) [minecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
Caused by: java.lang.NullPointerException
at dev.peteras17.tickets_and_fines.Main.onCommand(Main.java:145) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[min
ecraft_server.1.7.2.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
... 8 more

This is the code it is executing:
EconomyResponse r = AG.depositPlayer(args[0], -AJ); //Here is the error.
if(r.transactionSuccess()) {
sender.sendMessage(String.format("You were given %s and now have %s", AG.format(r.amount), AG.format(r.balance)));
} else {
sender.sendMessage(String.format("An error occured: %s", r.errorMessage));
}

AG it's the econ, AJ it's the amount, args[0] it's the string of the Player Name (as you can see in the command)

Can somebody help me please?

commented

this is not an issue with Vault, looks like you'll need to do some better debugging on your own code. If you're getting an error on that line, most likely AG is null.