fix: panic is no mibs folder is found (#10301)
This commit is contained in:
parent
b672de33a8
commit
e00147ded3
|
|
@ -55,6 +55,9 @@ func LoadMibsFromPath(paths []string, log telegraf.Logger) error {
|
||||||
appendPath(mibPath)
|
appendPath(mibPath)
|
||||||
folders = append(folders, mibPath)
|
folders = append(folders, mibPath)
|
||||||
err := filepath.Walk(mibPath, func(path string, info os.FileInfo, err error) error {
|
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
|
// symlinks are files so we need to double check if any of them are folders
|
||||||
// Will check file vs directory later on
|
// Will check file vs directory later on
|
||||||
if info.Mode()&os.ModeSymlink != 0 {
|
if info.Mode()&os.ModeSymlink != 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue