diff --git a/tools/clean-abandoned-files.js b/tools/clean-abandoned-files.js index c43c9c7d4ee4..33919220a149 100644 --- a/tools/clean-abandoned-files.js +++ b/tools/clean-abandoned-files.js @@ -18,7 +18,8 @@ function checkDir(path, index) { const fullname = subdir + "/" + filename if (!index.results.find(spec => spec[subdir] === fullname || - spec[subdir]?.find(extract => extract.file === fullname))) { + (Array.isArray(spec[subdir]) && + spec[subdir].find(extract => extract.file === fullname)))) { fs.unlinkSync(path + "/" + filename); } }