Don't inject if inactive (#2461)

This commit is contained in:
Juan Cruz Linsalata 2021-05-02 10:52:07 -03:00 committed by GitHub
parent af0cf1d3f2
commit 096415cf8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -51,6 +51,7 @@ public class BungeeChannelInitializer extends ChannelInitializer<Channel> {
// Add originals
this.method.invoke(this.original, socketChannel);
if (!socketChannel.isActive()) return; // Don't inject if inactive
if (socketChannel.pipeline().get("packet-encoder") == null) return; // Don't inject if no packet-encoder
if (socketChannel.pipeline().get("packet-decoder") == null) return; // Don't inject if no packet-decoder
// Add our transformers