From 9d1a027c0d06069dbbd387653b817723def15d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Sun, 29 Jan 2023 13:13:16 -0500 Subject: [PATCH] fix: error on heartbeat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo Arturo Cabral Mejía --- src/adapters/web-socket-server-adapter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/adapters/web-socket-server-adapter.ts b/src/adapters/web-socket-server-adapter.ts index 8600272b..6a99b406 100644 --- a/src/adapters/web-socket-server-adapter.ts +++ b/src/adapters/web-socket-server-adapter.ts @@ -101,7 +101,9 @@ export class WebSocketServerAdapter extends WebServerAdapter implements IWebSock private onHeartbeat() { this.webSocketServer.clients.forEach((webSocket) => { const webSocketAdapter = this.webSocketsAdapters.get(webSocket) as IWebSocketAdapter - webSocketAdapter.emit(WebSocketAdapterEvent.Heartbeat) + if (webSocketAdapter) { + webSocketAdapter.emit(WebSocketAdapterEvent.Heartbeat) + } }) } }