From 5b0603c32dcd34a9179d85f8f9e636876766aa78 Mon Sep 17 00:00:00 2001 From: Chris Aumann Date: Sat, 6 Mar 2021 18:39:02 +0100 Subject: [PATCH] Make GroupValue() more resilient --- pkg/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index caa1e50..9dd96d9 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -61,7 +61,7 @@ func (rf *Regexp) GroupValue(s string, groupName string) string { match := rf.r.FindStringSubmatch(s) groupValues := make(map[string]string) for i, name := range rf.r.SubexpNames() { - if name != "" { + if len(match) > i && name != "" { groupValues[name] = match[i] } }