diff --git a/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt b/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt index 17719c3e..33f5da19 100644 --- a/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt +++ b/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt @@ -61,9 +61,11 @@ public class LoginChannelHandler @Inject constructor( ) ctx.pipeline().remove(Rs2Decoder::class.java) - ctx.write(LoginResponse.Js5Ok).addListener { - ctx.pipeline().remove(Rs2Encoder::class.java) - ctx.pipeline().remove(this) + ctx.write(LoginResponse.Js5Ok).addListener { future -> + if (future.isSuccess) { + ctx.pipeline().remove(Rs2Encoder::class.java) + ctx.pipeline().remove(this) + } } }