Skip to content

Commit

Permalink
Add document null check in websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Jan 23, 2024
1 parent b119718 commit ed922b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sci-log-db/src/utils/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ed922b4

Please sign in to comment.