News:

Who uses forums anymore?

Main Menu

Shaman join throws java.lang.NullPointerException

Started by Lance, February 25, 2010, 09:27:46 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Lance

When a shaman joins the channel, I get this:

[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:

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.
Quote from: Joe
[23:55:31] [william@enterprise ~/Documents/Programming/javaop2]$ svn commit -m 'Tried to fix StayConnected. Again.'
Committed revision 63.
StayConnected strikes back!

Joe

Update your SVN and check again. I added a bunch of general bad data checking. :)
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Lance

Quote from: Joe on February 25, 2010, 02:08:23 PM
Update your SVN and check again. I added a bunch of general bad data checking. :)

Working great :)

Thanks!
Quote from: Joe
[23:55:31] [william@enterprise ~/Documents/Programming/javaop2]$ svn commit -m 'Tried to fix StayConnected. Again.'
Committed revision 63.
StayConnected strikes back!

Joe

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.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.