fix message "empty scenario"

This commit is contained in:
mmetc 2023-02-21 09:59:56 +01:00 committed by GitHub
parent 90c38db9f2
commit 76ea3a063f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,17 +64,16 @@ func formatAlertAsString(machineId string, alert *models.Alert) []string {
}
/**/
reason := ""
msg := ""
if alert.Scenario != nil && *alert.Scenario != "" {
msg = *alert.Scenario
} else if alert.Message != nil && *alert.Message != "" {
msg = *alert.Message
} else {
msg = fmt.Sprintf("empty scenario by %s", src)
msg = "empty scenario"
}
reason = fmt.Sprintf("%s by %s", msg, src)
reason := fmt.Sprintf("%s by %s", msg, src)
if len(alert.Decisions) > 0 {
for i, decisionItem := range alert.Decisions {