TheHolyWaffle / TeamSpeak-3-Java-API

A Java wrapper of TeamSpeak's 3 server query API.
MIT License
306 stars 107 forks source link

NullPointerException at .registerAllEvents() #410

Open SaftigeOrange opened 2 years ago

SaftigeOrange commented 2 years ago

Hello, when i load allEvents(".registerAllEvents()") i become a NullPointerException in my events class. This the error: Error Why is it so?

Thanks for helping

rogermb commented 2 years ago

Hi @SaftigeOrange

Could you please share the stack trace of the exception you're getting with us?

Also, it seems very suspicious that you're creating two instances of your TeamSpeakService. Are you sure you didn't mean to re-use the first TeamSpeakService?

That would explain why you, judging from the initial title, were getting an exception while trying to set your nickname. Nicknames on a TS3 server must be unique, so if you use a nickname that's already in use - as you would if you had 2 queries connecting to the same server and trying to use the same nickname - the command will fail and you'll get an exception.