Handle nil os.FileInfo in filepath.Walk

closes #2466
This commit is contained in:
Cameron Sparr
2017-02-23 13:45:36 +00:00
parent a38ebcbe54
commit 49ed1a278b
2 changed files with 5 additions and 0 deletions

View File

@@ -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
}