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 ba7f609d..8479227d 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 @@ -182,13 +182,18 @@ class ChannelInjector extends ByteToMessageDecoder { /** * Inject the current channel. + *
+ * Note that only active channels can be injected. + * @return TRUE if we injected the channel, false if we could not inject or it was already injected. */ @SuppressWarnings("unchecked") public boolean inject() { synchronized (networkManager) { if (originalChannel instanceof Factory) return false; - + if (!originalChannel.isActive()) + return false; + // Don't inject the same channel twice if (findChannelHandler(originalChannel, ChannelInjector.class) != null) { // Invalidate cache @@ -202,9 +207,9 @@ class ChannelInjector extends ByteToMessageDecoder { vanillaEncoder = (MessageToByteEncoder