Skip to content

Commit

Permalink
do not use empty string as regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jun 11, 2024
1 parent f534e93 commit 66afbdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packaging/snclient.ini
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ metrics interval = 5s
; device filter - exclude matching network devices from gathering network counter metrics, ex. for temporary devices
device filter = ^veth


; Unix system - Section for non windows system checks
[/settings/system/unix]

Expand Down
2 changes: 1 addition & 1 deletion pkg/snclient/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ func (cs *ConfigSection) GetBytes(key string) (val uint64, ok bool, err error) {
// If value is found but cannot be parsed, error is set.
func (cs *ConfigSection) GetRegexp(key string) (val *regexp.Regexp, ok bool, err error) {
raw, ok := cs.GetString(key)
if !ok {
if !ok || raw == "" {
return nil, false, nil
}
re, err := regexp.Compile(raw)
Expand Down

0 comments on commit 66afbdf

Please sign in to comment.