优化代码

This commit is contained in:
刘祥超
2023-07-03 17:12:24 +08:00
parent 74e909a501
commit 3f21b3148e
3 changed files with 7 additions and 6 deletions

View File

@@ -1135,11 +1135,12 @@ func (this *NodeClusterDAO) FindClusterUAMPolicy(tx *dbs.Tx, clusterId int64, ca
return nil, err
}
var policy = nodeconfigs.NewUAMPolicy()
if IsNull(uamJSON) {
return nodeconfigs.DefaultUAMPolicy, nil
return policy, nil
}
var policy = &nodeconfigs.UAMPolicy{}
err = json.Unmarshal(uamJSON, policy)
if err != nil {
return nil, err