fix(app): avoid nil panic (#693)

This commit is contained in:
mrh997 2025-08-12 10:03:34 +08:00 committed by GitHub
parent 643a448157
commit e7011f2549
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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 {