Исправление ошибки NPE при несуществующем пакете
Some checks failed
Build rosetta-wss / build (push) Has been cancelled
Some checks failed
Build rosetta-wss / build (push) Has been cancelled
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user