frafol / CleanStaffChat

Clean StaffChat is a basic StaffChat plugin, compatible with BungeeCord, Spigot and Velocity.
https://www.spigotmc.org/resources/cleansc-%E2%80%A2-best-staffchat-plugin-spigot-bungeecord-and-velocity-support.105220/
10 stars 6 forks source link

[Bug] Bungee: Join NPE #2

Closed Yurinann closed 1 year ago

Yurinann commented 1 year ago
[09:37:51 WARN]: Error dispatching event PostLoginEvent(player=Kiyotsuki) to listener it.frafol.cleanstaffchat.bungee.staffchat.listeners.JoinListener@481c1e92
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
        at it.frafol.cleanstaffchat.bungee.staffchat.listeners.JoinListener.lambda$handle$2(JoinListener.java:104) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
        at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1707) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
        at it.frafol.cleanstaffchat.bungee.staffchat.listeners.JoinListener.handle(JoinListener.java:99) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at net.md_5.bungee.event.EventBus.post(EventBus.java:50) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:510) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at net.md_5.bungee.connection.InitialHandler$6$1.run(InitialHandler.java:813) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:cd7ded3:unknown]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

FlameCord with Java17, also on waterfall

(maybe there need a runTaskLater 1-3L?)

frafol commented 1 year ago

try latest version

Yurinann commented 1 year ago

issue solved, thanks