Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 2b71367

Browse files
author
Dimitar Tachev
authored
Merge pull request #1103 from telerik/tachev/fix-should-build
fix: fix file not found exception when enumerating a dir with non existing symlinks
2 parents cef91c4 + 7440213 commit 2b71367

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

file-system.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,12 @@ export class FileSystem implements IFileSystem {
334334
const contents = this.readDirectory(directoryPath);
335335
for (let i = 0; i < contents.length; ++i) {
336336
const file = path.join(directoryPath, contents[i]);
337-
const stat = this.getFsStats(file);
338-
if (filterCallback && !filterCallback(file, stat)) {
337+
let stat: fs.Stats = null;
338+
if (this.exists(file)) {
339+
stat = this.getFsStats(file);
340+
}
341+
342+
if (!stat || (filterCallback && !filterCallback(file, stat))) {
339343
continue;
340344
}
341345

0 commit comments

Comments
 (0)