diff --git a/src/models/note.ts b/src/models/note.ts index 0efabc97d8..67ee525c31 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -294,7 +294,7 @@ export const pack = async ( } // Populate files - _note.files = Promise.all(_note.fileIds.map((fileId: mongo.ObjectID) => + _note.files = Promise.all((_note.fileIds || []).map((fileId: mongo.ObjectID) => packFile(fileId) ));