mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
analyzeRegexGroups should not have out of range error upon no match
This commit is contained in:
@@ -90,7 +90,7 @@ func analyzeRegexGroups(pattern string, collected []byte, outcomes []*troublesho
|
||||
|
||||
foundMatches := map[string]string{}
|
||||
for i, name := range re.SubexpNames() {
|
||||
if i != 0 && name != "" {
|
||||
if i != 0 && name != "" && len(match) > i {
|
||||
foundMatches[name] = match[i]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user