소스 검색

If revision is null, skip processing

Shun Miyazawa 1 년 전
부모
커밋
726a7dc45e
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      bin/data-migrations/src/index.js

+ 5 - 0
bin/data-migrations/src/index.js

@@ -36,6 +36,11 @@ pagesCollection.find({}).forEach((doc) => {
   if (doc.revision) {
     try {
       var revision = revisionsCollection.findOne({ _id: doc.revision });
+
+      if (revision == null || revision.body == null) {
+        return;
+      }
+
       var replacedBody = replaceLatestRevisions(revision.body, [...migrationModules]);
       var operation = {
         updateOne: {