Skip to content

Commit f986eb5

Browse files
committed
Do not print an exception if a client closed before switching to config state
1 parent 9d1332d commit f986eb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,11 @@ private boolean sendKeepAliveToBackend(final @Nullable VelocityServerConnection
12871287
public void switchToConfigState() {
12881288
server.getEventManager().fire(new PlayerEnterConfigurationEvent(this, getConnectionInFlightOrConnectedServer()))
12891289
.completeOnTimeout(null, 5, TimeUnit.SECONDS).thenRunAsync(() -> {
1290+
// if the connection was closed earlier, there is a risk that the player is no longer connected
1291+
if (!connection.getChannel().isActive()) {
1292+
return;
1293+
}
1294+
12901295
if (bundleHandler.isInBundleSession()) {
12911296
bundleHandler.toggleBundleSession();
12921297
connection.write(BundleDelimiterPacket.INSTANCE);

0 commit comments

Comments
 (0)