diff --git a/sources/src/wrapper-validation/find.ts b/sources/src/wrapper-validation/find.ts index de1a89e..7f638ca 100644 --- a/sources/src/wrapper-validation/find.ts +++ b/sources/src/wrapper-validation/find.ts @@ -18,9 +18,14 @@ async function recursivelyListFiles(baseDir: string): Promise { const childrenPaths = await Promise.all( childrenNames.map(async childName => { const childPath = path.resolve(baseDir, childName) - return fs.lstatSync(childPath).isDirectory() - ? recursivelyListFiles(childPath) - : new Promise(resolve => resolve([childPath])) + const stat = fs.lstatSync(childPath, {throwIfNoEntry: false}) + if (stat === undefined) { + return [] + } else if (stat.isDirectory()) { + return recursivelyListFiles(childPath) + } else { + return new Promise(resolve => resolve([childPath])) + } }) ) return Array.prototype.concat(...childrenPaths)