Skip to content

Commit

Permalink
bugfix: avoid nil reference when ignore is nil
Browse files Browse the repository at this point in the history
Signed-off-by: detailyang <detailyang@gmail.com>
  • Loading branch information
detailyang committed Jul 3, 2019
1 parent 0841244 commit eb2a4d4
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 eb2a4d4

Please sign in to comment.