From ed40ce27abbc32d09e2bb77def25f5d44ca218ea Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Thu, 7 Apr 2022 11:09:51 -0400 Subject: [PATCH] Merge pull request #7467 from overleaf/em-bad-filetree Find file trees that have null folder entries GitOrigin-RevId: aa4c7ed180479288d4ce26549ceeaa0f5ebbd298 --- services/web/scripts/find_malformed_filetrees.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/web/scripts/find_malformed_filetrees.js b/services/web/scripts/find_malformed_filetrees.js index 85efc82447..f195502ba6 100644 --- a/services/web/scripts/find_malformed_filetrees.js +++ b/services/web/scripts/find_malformed_filetrees.js @@ -41,6 +41,9 @@ function findBadPaths(folder) { } if (folder.folders && Array.isArray(folder.folders)) { for (const [i, subfolder] of folder.folders.entries()) { + if (!subfolder) { + result.push(`folders.${i}`) + } for (const badPath of findBadPaths(subfolder)) { result.push(`folders.${i}.${badPath}`) }