Skip to content

Commit

Permalink
bugfix: avoid nil reference when ignore is nil (#1414)
Browse files Browse the repository at this point in the history
Signed-off-by: detailyang <detailyang@gmail.com>
  • Loading branch information
detailyang authored and SuperQ committed Jul 12, 2019
1 parent f693a71 commit 7fe9713
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collector/netdev_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7fe9713

Please sign in to comment.