Add null check to channel close

This commit is contained in:
KennyTV 2020-04-23 21:09:41 +02:00
parent 762c66ff42
commit 886ac734f9
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

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