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