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

Signed-off-by: detailyang <detailyang@gmail.com>
This commit is contained in:
detailyang 2019-07-12 20:23:54 +08:00 committed by Ben Kochie
parent f693a71c06
commit 7fe9713edf
1 changed files with 1 additions and 1 deletions

View File

@ -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
}