diff --git a/pkg/services/apemanager/audit.go b/pkg/services/apemanager/audit.go index d132ae7db..73d9e3690 100644 --- a/pkg/services/apemanager/audit.go +++ b/pkg/services/apemanager/audit.go @@ -33,10 +33,15 @@ func (a *auditService) AddChain(ctx context.Context, req *apemanager.AddChainReq return res, err } + var respChainID []byte + if respBody := res.GetBody(); respBody != nil { + respChainID = respBody.GetChainID() + } + audit.LogRequest(a.log, ape_grpc.APEManagerService_AddChain_FullMethodName, req, audit.TargetFromChainID(req.GetBody().GetTarget().GetTargetType().String(), req.GetBody().GetTarget().GetName(), - res.GetBody().GetChainID()), + respChainID), err == nil) return res, err