From f986eb51ecf341fe3eec2a14a1f3563f4a58af21 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 13 Feb 2025 12:12:33 +0000 Subject: [PATCH] Do not print an exception if a client closed before switching to config state --- .../proxy/connection/client/ConnectedPlayer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index a7717055..be7a82b2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -1287,6 +1287,11 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player, public void switchToConfigState() { server.getEventManager().fire(new PlayerEnterConfigurationEvent(this, getConnectionInFlightOrConnectedServer())) .completeOnTimeout(null, 5, TimeUnit.SECONDS).thenRunAsync(() -> { + // if the connection was closed earlier, there is a risk that the player is no longer connected + if (!connection.getChannel().isActive()) { + return; + } + if (bundleHandler.isInBundleSession()) { bundleHandler.toggleBundleSession(); connection.write(BundleDelimiterPacket.INSTANCE);