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

Fix filetree entry with an empty name

GitOrigin-RevId: 2fecdde67954472e1d34bccc1ccf7015a0b98752
This commit is contained in:
Eric Mc Sween 2022-10-13 11:40:24 -04:00 committed by Copybot
parent 567efe007f
commit 20a69289db

View file

@ -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