Просмотр исходного кода

Merge pull request #9961 from overleaf/em-fix-empty-name

Fix filetree entry with an empty name

GitOrigin-RevId: 2fecdde67954472e1d34bccc1ccf7015a0b98752
Eric Mc Sween 4 лет назад
Родитель
Сommit
20a69289db
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      services/web/scripts/fix_malformed_filetree.js

+ 1 - 1
services/web/scripts/fix_malformed_filetree.js

@@ -156,7 +156,7 @@ async function fixName(projectId, path) {
   const existingNames = new Set(array.map(x => x.name))
   const existingNames = new Set(array.map(x => x.name))
   const name = findUniqueName(existingNames)
   const name = findUniqueName(existingNames)
   const result = await db.projects.updateOne(
   const result = await db.projects.updateOne(
-    { _id: projectId, [path]: { $exists: false } },
+    { _id: projectId, [path]: { $in: [null, ''] } },
     { $set: { [path]: name } }
     { $set: { [path]: name } }
   )
   )
   return result.modifiedCount
   return result.modifiedCount