From 97dca3de1c2ef97209262859258d762eb58ea747 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Thu, 7 Apr 2022 07:54:28 -0400 Subject: [PATCH] Merge pull request #7422 from overleaf/em-bad-filetree Cover more cases in bad filetree script GitOrigin-RevId: 76aea86f56b16c60d3ed853e486bf00137f0ea5c --- services/web/scripts/find_malformed_filetrees.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/web/scripts/find_malformed_filetrees.js b/services/web/scripts/find_malformed_filetrees.js index 1b33fcdb10..85efc82447 100644 --- a/services/web/scripts/find_malformed_filetrees.js +++ b/services/web/scripts/find_malformed_filetrees.js @@ -18,6 +18,14 @@ async function main() { } function processProject(project) { + if (!project.rootFolder || !Array.isArray(project.rootFolder)) { + console.log('BAD PATH:', project._id, 'rootFolder') + return + } + if (!project.rootFolder[0]) { + console.log('BAD PATH:', project._id, 'rootFolder.0') + return + } const badPaths = findBadPaths(project.rootFolder[0]) for (const path of badPaths) { console.log('BAD PATH:', project._id, `rootFolder.0.${path}`)