From 20a69289dbf5bcfc76002c9ddd1fb3269697d4a8 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Thu, 13 Oct 2022 11:40:24 -0400 Subject: [PATCH] Merge pull request #9961 from overleaf/em-fix-empty-name Fix filetree entry with an empty name GitOrigin-RevId: 2fecdde67954472e1d34bccc1ccf7015a0b98752 --- services/web/scripts/fix_malformed_filetree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/scripts/fix_malformed_filetree.js b/services/web/scripts/fix_malformed_filetree.js index a00e098972..9c7e34f93a 100644 --- a/services/web/scripts/fix_malformed_filetree.js +++ b/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 name = findUniqueName(existingNames) const result = await db.projects.updateOne( - { _id: projectId, [path]: { $exists: false } }, + { _id: projectId, [path]: { $in: [null, ''] } }, { $set: { [path]: name } } ) return result.modifiedCount