alert record bugfix

1.return details fix
This commit is contained in:
zhaoxiangchun
2020-09-01 20:46:15 +08:00
parent 74c8c6bfe2
commit bb22fba257
+7 -4
View File
@@ -137,11 +137,14 @@ func (man *SAlertRecordManager) FetchCustomizeColumns(
func (record *SAlertRecord) GetMoreDetails(out monitor.AlertRecordDetails) (monitor.AlertRecordDetails, error) {
evalMatchs := make([]monitor.EvalMatch, 0)
err := record.EvalData.Unmarshal(evalMatchs)
if err != nil {
return out, errors.Wrap(err, "record Unmarshal evalMatchs error")
if record.EvalData != nil {
err := record.EvalData.Unmarshal(&evalMatchs)
if err != nil {
return out, errors.Wrap(err, "record Unmarshal evalMatchs error")
}
out.ResNum = int64(len(evalMatchs))
}
out.ResNum = int64(len(evalMatchs))
return out, nil
}