diff --git a/backend/src/index.ts b/backend/src/index.ts index 87ae3f9..e6ca758 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -55,8 +55,10 @@ export class ConnectionManager { public removeConnection(hash: string) { const connection = this.connections[hash] - connection.disconnect() - delete this.connections[hash] + if (connection) { + connection.disconnect() + delete this.connections[hash] + } } public closeAllConnections() {