diff --git a/src/adapters/web-socket-server-adapter.ts b/src/adapters/web-socket-server-adapter.ts index 8600272..6a99b40 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) + } }) } }