Skip to content

Commit

Permalink
Make GroupValue() more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
chr4 committed Mar 6, 2021
1 parent d2af68b commit 5b0603c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down

0 comments on commit 5b0603c

Please sign in to comment.