From d157428b73881e1be8bc74a49050e32c63507f82 Mon Sep 17 00:00:00 2001 From: minottic Date: Fri, 6 Oct 2023 13:24:03 +0200 Subject: [PATCH] Add websocket safety net --- sci-log-db/src/utils/websocket.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sci-log-db/src/utils/websocket.ts b/sci-log-db/src/utils/websocket.ts index 3371de4b..7c1cd18b 100644 --- a/sci-log-db/src/utils/websocket.ts +++ b/sci-log-db/src/utils/websocket.ts @@ -192,6 +192,7 @@ export async function startWebsocket(app: SciLogDbApplication) { const doc = await collection.findOne({ _id: Mongo.ObjectId(change.documentKey._id), }); + if (!doc) return; // console.log(websocketMap[id]) if (typeof websocketMap[id] != 'undefined') { // eslint-disable-next-line @typescript-eslint/no-explicit-any