From 92e2a6c86d8bb4d0b76d5e9343e3e59460467b43 Mon Sep 17 00:00:00 2001 From: Gravita Date: Thu, 15 Apr 2021 21:02:46 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20NPE=20=D0=B2=20`clients`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launchserver/command/service/ClientsCommand.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java index 6956dde8..d82dd937 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java @@ -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)