Ver Fonte

If revision is null, skip processing

Shun Miyazawa há 1 ano atrás
pai
commit
726a7dc45e
1 ficheiros alterados com 5 adições e 0 exclusões
  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: {