NEZNAMY / TAB

"That" TAB plugin.
Apache License 2.0
903 stars 245 forks source link

[BungeeCord] Disconnect with NPE on item.listOrder #1359

Closed chrissamael closed 2 months ago

chrissamael commented 2 months ago

Server version

Paper 1.21

TAB version

4.1.7

Stack trace

17:06:04 [SEVERE] [chrissamael] -> UpstreamBridge - encountered exception
io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "item.listOrder" is null
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:125)
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893)
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875)
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984)
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868)
    at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115)
    at me.neznamy.tab.shared.features.injection.NettyPipelineInjector$TabChannelDuplexHandler.write(NettyPipelineInjector.java:115)
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:891)
    at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:956)
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:982)
    at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:950)
    at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1019)
    at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:310)
    at net.md_5.bungee.netty.ChannelWrapper.write(ChannelWrapper.java:90)
    at net.md_5.bungee.UserConnection$1.sendPacket(UserConnection.java:155)
    at net.md_5.bungee.UserConnection.sendQueuedPackets(UserConnection.java:204)
    at net.md_5.bungee.connection.UpstreamBridge.handle(UpstreamBridge.java:371)
    at net.md_5.bungee.protocol.packet.FinishConfiguration.handle(FinishConfiguration.java:35)
    at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:128)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799)
    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501)
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "item.listOrder" is null
    at net.md_5.bungee.protocol.packet.PlayerListItemUpdate.write(PlayerListItemUpdate.java:116)
    at net.md_5.bungee.protocol.DefinedPacket.write(DefinedPacket.java:539)
    at net.md_5.bungee.protocol.MinecraftEncoder.encode(MinecraftEncoder.java:27)
    at net.md_5.bungee.protocol.MinecraftEncoder.encode(MinecraftEncoder.java:10)
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
    ... 52 more

Steps to reproduce (if known)

Step 1: use latest build of bungeecord Step 2: enable global-playerlist Step 3: join network with one player Step 4: join network with another player

Additional info

No response

Checklist

NEZNAMY commented 2 months ago

Why does paper 1.21 throw bungeecord error? Looks like the PR to BungeeCord for 24w34a support forgot to add version check for listOrder writing. This will require a breaking change in TAB to avoid. For now, downgrade to BungeeCord build 1860 or older.