From cf9d1f29946d0ff6448eb00e4ddde4af4dc04613 Mon Sep 17 00:00:00 2001 From: Royce59 Date: Fri, 20 Feb 2026 23:16:49 +0200 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20NPE=20=D0=BF=D1=80=D0=B8=20=D0=BD=D0=B5=D1=81=D1=83=D1=89?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B5=D0=BC=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=BA=D0=B5=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/orprotocol/Server.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/orprotocol/Server.java b/src/main/java/io/orprotocol/Server.java index 0f4350c..658e523 100644 --- a/src/main/java/io/orprotocol/Server.java +++ b/src/main/java/io/orprotocol/Server.java @@ -116,6 +116,13 @@ public class Server extends WebSocketServer { */ @SuppressWarnings("rawtypes") PacketExecutor executor = this.packetManager.getExecutors().get(packetId); + if(executor == null){ + /** + * Нет назначенного обработчика для этого packetId + */ + client.disconnect(ServerFailures.UNSUPPORTED_PACKET); + return; + } executor.settings = this.settings; if(listener != null && !listener.onPacketReceived(this, client, packet)) { /** @@ -143,7 +150,7 @@ public class Server extends WebSocketServer { } } catch (Exception e) { e.printStackTrace(); - //client.disconnect(ServerFailures.UNSUPPORTED_PACKET); + //client.disconnect(ServerFailures.BAD_PACKET); } }