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);