From e0d7f45ab88a23650e7f4b40950f488886299289 Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Sun, 27 Jan 2019 00:13:06 +0100 Subject: [PATCH] Fix crash due to conneciton error Error report: b6ef904c-b670-41e8-b586-fab52a31006d --- backend/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() {