diff --git a/tools/migration/use-gridfs.js b/tools/migration/use-gridfs.js index 148f9be261..f13d3c874e 100644 --- a/tools/migration/use-gridfs.js +++ b/tools/migration/use-gridfs.js @@ -19,7 +19,7 @@ const writeToGridFS = (bucket, buffer, ...rest) => new Promise((resolve, reject) const migrateToGridFS = async (doc) => { const id = doc._id - const buffer = doc.data.buffer + const buffer = doc.data ? doc.data.buffer : Buffer.from([0x00]) // アップロードのバグなのか知らないけどなぜか data が存在しない drive_file ドキュメントがまれにあることがわかったので const created_at = doc.created_at const name = doc.name