nijikokun / iConomy3

Please, if you fork iConomy only do so if you are really fixing or adding something useful!
7 stars 1 forks source link

[BUG][4.1] SQLite NullPointerException on unknown accounts #10

Open SquallSeeD31 opened 13 years ago

SquallSeeD31 commented 13 years ago

When using a SQLite database, a NullPointerException is thrown when attempting to pay or grant money to an account that does not yet exist.

DB: SQLite CraftBukkit: 440

2011-02-28 04:05:37 [SEVERE] java.lang.NullPointerException 2011-02-28 04:05:37 [SEVERE] at com.nijiko.coelho.iConomy.util.Messaging.argument(Messaging.java:51) 2011-02-28 04:05:37 [SEVERE] at com.nijiko.coelho.iConomy.util.Template.parse(Template.java:49) 2011-02-28 04:05:37 [SEVERE] at com.nijiko.coelho.iConomy.entity.iPlayerListener.onPlayerCommand(iPlayerListener.java:482) 2011-02-28 04:05:37 [SEVERE] at com.nijiko.coelho.iConomy.iConomy.onCommand(iConomy.java:133) 2011-02-28 04:05:37 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:19) 2011-02-28 04:05:37 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77) 2011-02-28 04:05:37 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:176) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:638) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:601) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:595) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.Packet3Chat.a(SourceFile:24) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.NetworkManager.a(SourceFile:230) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:100) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253) 2011-02-28 04:05:37 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)

ShadowDrakken commented 13 years ago

Additional information, quoted from Janb (via Bukkit forums)

Okay so, I was able to actually produce some errors. I log into my server with another account, one which isn't mentioned in Permissions and should default to guest with:

Anytime that user tries to issue a /money pay command (/money stats and such work) to anyone (herself or my admin), the server returns:

Code: 2011-02-28 01:47:25 [SEVERE] java.lang.NullPointerException 2011-02-28 01:47:25 [SEVERE] at com.nijiko.coelho.iConomy.util.Messaging.colorize(Messaging.java:95) 2011-02-28 01:47:25 [SEVERE] at com.nijiko.coelho.iConomy.util.Template.color(Template.java:45) 2011-02-28 01:47:25 [SEVERE] at com.nijiko.coelho.iConomy.entity.iPlayerListener.showPayment(iPlayerListener.java:81) 2011-02-28 01:47:25 [SEVERE] at com.nijiko.coelho.iConomy.entity.iPlayerListener.onPlayerCommand(iPlayerListener.java:497) 2011-02-28 01:47:25 [SEVERE] at com.nijiko.coelho.iConomy.iConomy.onCommand(iConomy.java:133) 2011-02-28 01:47:25 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:19) 2011-02-28 01:47:25 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77) 2011-02-28 01:47:25 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:176) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:638) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:601) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:595) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.Packet3Chat.a(SourceFile:24) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.NetworkManager.a(SourceFile:230) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:100) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253) 2011-02-28 01:47:25 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:366) I open another MC instance, log in with my admin user at the same time, and pay works just fine for both users. My admin guy logs out while my guest guy is still logged in and the /money pay command reverts to causing the same error messages.

I log out with the 'guest' user and log back in (without the concurrent admin logged in) and THIS time, my guest is able to /money pay my admin, but gets the same errors as before when she tries to pay herself. Stopping and restarting the server still doesn't save the account status in these tests. I don't know if any of this is helpful, but I thought I'd report it.