mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-08-27 00:37:20 +00:00
Merge pull request #451 from replicatedhq/divolgin/panic
Check nil pointers
This commit is contained in:
@@ -99,14 +99,14 @@ func analyzeRegexPattern(pattern string, collected []byte, outcomes []*troublesh
|
||||
|
||||
reMatch := re.MatchString(string(collected))
|
||||
failWhen := false
|
||||
if failOutcome.When != "" {
|
||||
if failOutcome != nil && failOutcome.When != "" {
|
||||
failWhen, err = strconv.ParseBool(failOutcome.When)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to process when statement: %s", failOutcome.When)
|
||||
}
|
||||
}
|
||||
passWhen := true
|
||||
if passOutcome.When != "" {
|
||||
if passOutcome != nil && passOutcome.When != "" {
|
||||
passWhen, err = strconv.ParseBool(passOutcome.When)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to process when statement: %s", passOutcome.When)
|
||||
|
||||
Reference in New Issue
Block a user