From 30c0f9869174127f917505fed79194127c1a0eb0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 3 Oct 2018 22:54:10 +0900 Subject: [PATCH] Fix bug --- src/models/note.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) ));