beanbeanjuice / SimpleProxyChat

A bungeecord/waterfall plugin to send chat messages between servers.
GNU General Public License v3.0
8 stars 3 forks source link

[BUG]: Null Server #76

Closed beanbeanjuice closed 8 months ago

beanbeanjuice commented 8 months ago

Is there an existing issue for this?

Version

0.2.4

What proxy software are you seeing this issue on?

Waterfall

What proxy software version are you using?

1.20

Current Behaviour

[23:20:25 ERROR]: Task BungeeTask(sched=net.md_5.bungee.scheduler.BungeeScheduler@e4d2696, id=144, owner=com.beanbeanjuice.simpleproxychat.SimpleProxyChatBungee@41f5f4ba, task=com.beanbeanjuice.simpleproxychat.utility.listeners.bungee.BungeeServerListener$$Lambda$2971/0x00007fb648b3b3b8@32c4e3a6, delay=50, period=0, running=true) encountered an exception
java.lang.NullPointerException: Cannot invoke "net.md_5.bungee.api.connection.Server.getInfo()" because the return value of "net.md_5.bungee.api.connection.ProxiedPlayer.getServer()" is null

Expected Behaviour

https://github.com/beanbeanjuice/SimpleProxyChat/blob/811bdb1945d22f9905313725730de9d18e01f5d8/src/main/java/com/beanbeanjuice/simpleproxychat/utility/listeners/bungee/BungeeServerListener.java#L85-L98

This function should not call Player#getServer, but instead Server#getInfo directly.

Steps to Reproduce

This seems to be an intermittent thing that occurs on Bungee only. It happens when joining the proxy.

Are you certain this is a bug report?