Skip to content

Commit

Permalink
Merge pull request #47 from chr4/feat/topic-resillience
Browse files Browse the repository at this point in the history
Make GroupValue() more resilient
  • Loading branch information
hikhvar authored Mar 6, 2021
2 parents d2af68b + 5b0603c commit 8319830
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 8319830

Please sign in to comment.