Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible NoSuchElementException #3769

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ public void setCompressionThreshold(int compressionThreshold)
ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold );
} else
{
ch.pipeline().remove( "compress" );
if ( ch.pipeline().get( PacketCompressor.class ) != null )
{
ch.pipeline().remove( "compress" );
}
}

if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold >= 0 )
Expand All @@ -198,7 +201,10 @@ public void setCompressionThreshold(int compressionThreshold)
}
if ( compressionThreshold < 0 )
{
ch.pipeline().remove( "decompress" );
if ( ch.pipeline().get( PacketDecompressor.class ) != null )
{
ch.pipeline().remove( "decompress" );
}
}
// disable use of composite buffers if we use natives
updateComposite();
Expand Down