diff --git a/internal/patternkey/patternkeys_values.go b/internal/patternkey/patternkeys_values.go index d075409..95b13bf 100644 --- a/internal/patternkey/patternkeys_values.go +++ b/internal/patternkey/patternkeys_values.go @@ -51,6 +51,9 @@ func PatternKeysFrom(values ...string) *PatterKeys { // Prepare values by message func (tags *PatterKeys) Prepare(msg message.Message) []string { + if tags == nil || len(tags.keys) == 0 { + return nil + } vals := make([]string, 0, len(tags.keys)) for _, tag := range tags.keys { vals = append(vals, tag.Prepare(msg))