bugfix: avoid nil reference when ignore is nil (#1414)
Signed-off-by: detailyang <detailyang@gmail.com>
This commit is contained in:
parent
f693a71c06
commit
7fe9713edf
|
@ -42,7 +42,7 @@ func getNetDevStats(ignore *regexp.Regexp, accept *regexp.Regexp) (map[string]ma
|
|||
continue
|
||||
}
|
||||
|
||||
if ignore.MatchString(iface.Name) {
|
||||
if ignore != nil && ignore.MatchString(iface.Name) {
|
||||
log.Debugf("Ignoring device: %s", iface.Name)
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue