We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca81468 commit d4d0d43Copy full SHA for d4d0d43
dirent.go
@@ -5,6 +5,7 @@ import (
5
"os"
6
"sync"
7
"sync/atomic"
8
+ "syscall"
9
"unsafe"
10
)
11
@@ -36,6 +37,9 @@ func loadFileInfo(pinfo **fileInfo) *fileInfo {
36
37
// If fs.DirEntry de is a fastwalk.DirEntry it's Stat() method is used and the
38
// returned fs.FileInfo may be a previously cached result.
39
func StatDirEntry(path string, de fs.DirEntry) (fs.FileInfo, error) {
40
+ if de == nil {
41
+ return nil, &os.PathError{Op: "stat", Path: path, Err: syscall.EINVAL}
42
+ }
43
if de.Type()&os.ModeSymlink == 0 {
44
return de.Info()
45
}
0 commit comments