diff --git a/sci-log-db/src/utils/websocket.ts b/sci-log-db/src/utils/websocket.ts index 7c1cd18b..d656ed3b 100644 --- a/sci-log-db/src/utils/websocket.ts +++ b/sci-log-db/src/utils/websocket.ts @@ -137,7 +137,7 @@ export async function startWebsocket(app: SciLogDbApplication) { .findOne({_id: Mongo.ObjectId(parentId)}); // eslint-disable-next-line @typescript-eslint/no-explicit-any return parentDoc.then((document: any) => { - if (document.snippetType === 'logbook') { + if (document?.snippetType === 'logbook') { sendSocketMessage(document._id); return document._id; } else if (document.parentId) {