Skip to content

Commit

Permalink
Handle nil os.FileInfo in filepath.Walk
Browse files Browse the repository at this point in the history
closes #2466
  • Loading branch information
sparrc committed Feb 23, 2017
1 parent 81408f9 commit 20513dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ func PrintOutputConfig(name string) error {

func (c *Config) LoadDirectory(path string) error {
walkfn := func(thispath string, info os.FileInfo, _ error) error {
if info == nil {
log.Printf("W! Telegraf is not permitted to read %s", thispath)
return nil
}
if info.IsDir() {
return nil
}
Expand Down

0 comments on commit 20513dc

Please sign in to comment.