Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 19c4b5d

Browse files
committed
Catch exception after lstat call
lstat can fail on Windows because of file/directory permissions
1 parent 69521f6 commit 19c4b5d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/path-scanner.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ class PathScanner extends EventEmitter
9696
stat: (filePath) ->
9797
# lstat is SLOW, but what other way to determine if something is a directory or file ?
9898
# also, sync is about 200ms faster than async...
99-
stat = fs.lstatSync(filePath)
99+
try
100+
stat = fs.lstatSync(filePath)
101+
catch e
102+
return null
100103

101104
if @options.follow and stat.isSymbolicLink()
102105
if @isInternalSymlink(filePath)

0 commit comments

Comments
 (0)