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

Commit

Permalink
Catch exception after lstat call
Browse files Browse the repository at this point in the history
lstat can fail on Windows because of file/directory permissions
  • Loading branch information
yuri-per committed Aug 11, 2023
1 parent 69521f6 commit 25f1f02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/path-scanner.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ class PathScanner extends EventEmitter
stat: (filePath) ->
# lstat is SLOW, but what other way to determine if something is a directory or file ?
# also, sync is about 200ms faster than async...
stat = fs.lstatSync(filePath)
try
stat = fs.lstatSync(filePath)
catch e
return null

if @options.follow and stat.isSymbolicLink()
if @isInternalSymlink(filePath)
Expand Down

0 comments on commit 25f1f02

Please sign in to comment.