bugfix: avoid nil reference when ignore is nil (#1414)

Signed-off-by: detailyang <detailyang@gmail.com>
pull/1423/head
detailyang 5 years ago committed by Ben Kochie
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…
Cancel
Save