Skip to content

Commit

Permalink
fix: panic is no mibs folder is found (influxdata#10301)
Browse files Browse the repository at this point in the history
  • Loading branch information
MyaLongmire authored Dec 17, 2021
1 parent b672de3 commit e00147d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/snmp/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func LoadMibsFromPath(paths []string, log telegraf.Logger) error {
appendPath(mibPath)
folders = append(folders, mibPath)
err := filepath.Walk(mibPath, func(path string, info os.FileInfo, err error) error {
if info == nil {
return fmt.Errorf("no mibs found")
}
// symlinks are files so we need to double check if any of them are folders
// Will check file vs directory later on
if info.Mode()&os.ModeSymlink != 0 {
Expand Down

0 comments on commit e00147d

Please sign in to comment.