Clan x86

Technical (Development, Security, etc.) => JavaOp Board => Topic started by: Lance on February 25, 2010, 09:27:46 am

Title: Shaman join throws java.lang.NullPointerException
Post by: Lance on February 25, 2010, 09:27:46 am
When a shaman joins the channel, I get this:
Code: [Select]
[TIME] WARNING: Error processing event: java.lang.NullPointerException
and events are no longer received from that shaman! If I make the bot leave the clan channel and come back, it does not see the shaman in the channel.

After throwing in a .prinstackTrace() in BnetEventProcess, and running eclipse debug, I got this:
Code: [Select]
java.lang.NullPointerException
at com.javaop.users.Statstring.getClient(Statstring.java:33)
at com.javaop.SwingGui.JavaOpPanel.userFlags(Unknown Source)
at com.javaop.pluginmanagers.PluginRegistration.userFlags(PluginRegistration.java:538)
at com.javaop.bot.BotCore.userFlags(BotCore.java:487)
at com.javaop.BnetEventProcess.PluginMain.processEvent(PluginMain.java:249)
at com.javaop.BnetEventProcess.PluginMain.access$1(PluginMain.java:220)
at com.javaop.BnetEventProcess.PluginMain$Callback.run(PluginMain.java:208)
at java.util.TimerThread.mainLoop(Timer.java:534)
at java.util.TimerThread.run(Timer.java:484)

This has been a problem for a while, starting around 2.1.1 if I remember right.

EDIT: It looks like "String[] tokens" is not being set by com.javaop.users.Statstring because the statstring passed to the constructor is null.
Title: Re: Shaman join throws java.lang.NullPointerException
Post by: Joe on February 25, 2010, 02:08:23 pm
Update your SVN and check again. I added a bunch of general bad data checking. :)
Title: Re: Shaman join throws java.lang.NullPointerException
Post by: Lance on February 25, 2010, 02:36:24 pm
Update your SVN and check again. I added a bunch of general bad data checking. :)

Working great :)

Thanks!
Title: Re: Shaman join throws java.lang.NullPointerException
Post by: Joe on February 25, 2010, 05:27:38 pm
When I committed I was thinking "Man, I hope this works, but I don't expect it to.."

The issue is that shamans join the channel with normal user flags (non-ops), and I'm guessing no statstring, and then are sent a stat update with their ops flag. That's why a fast ops bot can ban shamans.