Skip to content

Commit

Permalink
Check if info is nil, return appropriate error if so, should fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDiscordian committed Jun 2, 2021
1 parent cf11f39 commit 7a9f8d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ func MakeDir(path string) error {
func filePathWalkDir(root string) ([]string, error) {
var files []string
err := filepath.WalkDir(root, func(path string, info fs.DirEntry, err error) error {
if info == nil {
return errors.New(fmt.Sprintf("cannot access '%s' for crawling", path))
}
if !info.IsDir() {
filePathSplit := strings.Split(path, "/")
if IgnoreHidden && filePathSplit[len(filePathSplit)-1][0] == '.' {
Expand Down

0 comments on commit 7a9f8d1

Please sign in to comment.