[FIX] NPE в clients

This commit is contained in:
Gravita 2021-04-15 21:02:46 +07:00
parent 5bbe63f78c
commit 92e2a6c86d

View file

@ -30,6 +30,10 @@ public void invoke(String... args) {
WebSocketService service = server.nettyServerSocketHandler.nettyServer.service;
service.channels.forEach((channel -> {
WebSocketFrameHandler frameHandler = channel.pipeline().get(WebSocketFrameHandler.class);
if(frameHandler == null) {
LogHelper.info("Channel %s", IOHelper.getIP(channel.remoteAddress()));
return;
}
Client client = frameHandler.getClient();
String ip = frameHandler.context.ip != null ? frameHandler.context.ip : IOHelper.getIP(channel.remoteAddress());
if (!client.isAuth)