Don't attempt to decode empty buffers (fixes #482)

Stuff like this makes me want to drop support for <=1.13 versions of Minecraft.
This commit is contained in:
Andrew Steinborn
2021-04-25 10:14:13 -04:00
parent d7435fcbb6
commit 81311e7516

View File

@@ -62,7 +62,7 @@ public class MinecraftDecoder extends ChannelInboundHandlerAdapter {
}
private void tryDecode(ChannelHandlerContext ctx, ByteBuf buf) throws Exception {
if (!ctx.channel().isActive()) {
if (!ctx.channel().isActive() || !buf.isReadable()) {
buf.release();
return;
}