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) => {