mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(monitor): alert panic (#20150)
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/appctx"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/rbacscope"
|
||||
"yunion.io/x/pkg/util/sets"
|
||||
"yunion.io/x/pkg/utils"
|
||||
@@ -703,6 +704,9 @@ func (alert *SCommonAlert) GetMoreDetails(ctx context.Context, out monitor.Commo
|
||||
if err != nil {
|
||||
return out, errors.Wrap(err, "get notify")
|
||||
}
|
||||
if noti == nil || gotypes.IsNil(noti) || noti.Settings.IsZero() {
|
||||
continue
|
||||
}
|
||||
settings := new(monitor.NotificationSettingOneCloud)
|
||||
if err := noti.Settings.Unmarshal(settings); err != nil {
|
||||
return out, errors.Wrap(err, "Unmarshal to NotificationSettingOneCloud")
|
||||
|
||||
Reference in New Issue
Block a user