From be95fbc430e13c9f3efed5788362d0e61c3b83b9 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Sun, 8 Dec 2013 14:34:55 +0100 Subject: [PATCH] Only patch the encoder if it was found. --- .../com/comphenix/protocol/injector/netty/ChannelInjector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java index 2019ba84..66295b52 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java @@ -200,12 +200,12 @@ class ChannelInjector extends ByteToMessageDecoder { // Get the vanilla decoder, so we don't have to replicate the work vanillaDecoder = (ByteToMessageDecoder) originalChannel.pipeline().get("decoder"); vanillaEncoder = (MessageToByteEncoder) originalChannel.pipeline().get("encoder"); - patchEncoder(vanillaEncoder); if (vanillaDecoder == null) throw new IllegalArgumentException("Unable to find vanilla decoder.in " + originalChannel.pipeline()); if (vanillaEncoder == null) throw new IllegalArgumentException("Unable to find vanilla encoder in " + originalChannel.pipeline()); + patchEncoder(vanillaEncoder); if (DECODE_BUFFER == null) DECODE_BUFFER = FuzzyReflection.getMethodAccessor(vanillaDecoder.getClass(),