Skip to content

Commit 33580e9

Browse files
authored
Merge pull request #182 from replicatedhq/laverya/no-regex-panic-when-not-found
analyzeRegexGroups should not have out of range error upon no match
2 parents 7626f7d + 09bc81e commit 33580e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/analyze/text_analyze.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func analyzeRegexGroups(pattern string, collected []byte, outcomes []*troublesho
9090

9191
foundMatches := map[string]string{}
9292
for i, name := range re.SubexpNames() {
93-
if i != 0 && name != "" {
93+
if i != 0 && name != "" && len(match) > i {
9494
foundMatches[name] = match[i]
9595
}
9696
}

0 commit comments

Comments
 (0)