3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Add null check to channel close

Dieser Commit ist enthalten in:
KennyTV 2020-04-23 21:09:41 +02:00
Ursprung 762c66ff42
Commit 886ac734f9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -20,8 +20,10 @@ public class ViaConnectionManager {
connections.add(connection); connections.add(connection);
clients.put(id, connection); clients.put(id, connection);
if (connection.getChannel() != null) {
connection.getChannel().closeFuture().addListener((ChannelFutureListener) future -> onDisconnect(connection)); connection.getChannel().closeFuture().addListener((ChannelFutureListener) future -> onDisconnect(connection));
} }
}
public void onDisconnect(UserConnection connection) { public void onDisconnect(UserConnection connection) {
Objects.requireNonNull(connection, "connection is null!"); Objects.requireNonNull(connection, "connection is null!");