Skip to content

Commit

Permalink
fix: panic when no json filter is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
marianozunino committed Nov 25, 2024
1 parent 0eb304c commit bbeede3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,14 @@ func (c *Config) PrintConfig() (string, error) {
"FilterConfig": map[string]interface{}{
"IncludePatterns": c.FilterConfig.IncludePatterns,
"ExcludePatterns": c.FilterConfig.ExcludePatterns,
"JSONFilter": c.FilterConfig.JSONFilter.String(),
"MaxMessageSize": c.FilterConfig.MaxMessageSize,
"RegexPattern": c.FilterConfig.RegexPattern,
"JSONFilter": func() string {
if c.FilterConfig.JSONFilter != nil {
return c.FilterConfig.JSONFilter.String()
}
return ""
}(),
"MaxMessageSize": c.FilterConfig.MaxMessageSize,
"RegexPattern": c.FilterConfig.RegexPattern,
},
}, "", " ")
if err != nil {
Expand Down

0 comments on commit bbeede3

Please sign in to comment.