From ec2eaaf3e22b8c8e2b8b77252dfc3b6da63d1508 Mon Sep 17 00:00:00 2001 From: minottic Date: Fri, 26 Jan 2024 14:31:23 +0100 Subject: [PATCH] Add check for null in websocket --- sci-log-db/src/utils/websocket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-log-db/src/utils/websocket.ts b/sci-log-db/src/utils/websocket.ts index d656ed3b..786b01c5 100644 --- a/sci-log-db/src/utils/websocket.ts +++ b/sci-log-db/src/utils/websocket.ts @@ -140,7 +140,7 @@ export async function startWebsocket(app: SciLogDbApplication) { if (document?.snippetType === 'logbook') { sendSocketMessage(document._id); return document._id; - } else if (document.parentId) { + } else if (document?.parentId) { findParentLogbook(db, document.parentId, sendSocketMessage).then( // eslint-disable-next-line @typescript-eslint/no-explicit-any (d: any) => {