fix(app): avoid nil panic (#693)
This commit is contained in:
parent
643a448157
commit
e7011f2549
|
|
@ -354,8 +354,8 @@ func (s *SearchApplicationService) packProjectResource(ctx context.Context, reso
|
||||||
logs.CtxErrorf(ctx, "GetDataInfo failed, resID=%d, resType=%d, err=%v",
|
logs.CtxErrorf(ctx, "GetDataInfo failed, resID=%d, resType=%d, err=%v",
|
||||||
resource.ResID, resource.ResType, err)
|
resource.ResID, resource.ResType, err)
|
||||||
} else {
|
} else {
|
||||||
info.BizResStatus = ptr.Of(*di.status)
|
info.BizResStatus = di.status
|
||||||
if *di.status == int32(knowledgeModel.KnowledgeStatusDisable) {
|
if di.status != nil && *di.status == int32(knowledgeModel.KnowledgeStatusDisable) {
|
||||||
actions := slices.Clone(info.Actions)
|
actions := slices.Clone(info.Actions)
|
||||||
for _, a := range actions {
|
for _, a := range actions {
|
||||||
if a.Key == common.ProjectResourceActionKey_Disable {
|
if a.Key == common.ProjectResourceActionKey_Disable {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue