Author Topic: Shaman join throws java.lang.NullPointerException  (Read 5282 times)

0 Members and 1 Guest are viewing this topic.

Offline Lance

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Shaman join throws java.lang.NullPointerException
« 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.
« Last Edit: February 25, 2010, 09:52:27 am by Lance »
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!

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Shaman join throws java.lang.NullPointerException
« Reply #1 on: February 25, 2010, 02:08:23 pm »
Update your SVN and check again. I added a bunch of general bad data checking. :)
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Lance

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Re: Shaman join throws java.lang.NullPointerException
« Reply #2 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!
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!

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Shaman join throws java.lang.NullPointerException
« Reply #3 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.
I'd personally do as Joe suggests

You might be right about that, Joe.