Skip to content

Commit

Permalink
Prevent panic if fileinfo is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton committed Oct 11, 2018
1 parent f0c24fa commit 14a02de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/inputs/filecount/filecount.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ func absDuration(x time.Duration) time.Duration {

func count(basedir string, recursive bool, countFn countFunc) error {
walkFn := func(path string, file os.FileInfo, err error) error {
if file == nil {
return fmt.Errorf("Nil file found at %q", path)
}
if path == basedir {
return nil
}
Expand Down

0 comments on commit 14a02de

Please sign in to comment.