Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: response could be nil (#15204)

p0ny17e4883b48bc
diff --git a/backend/api/v1/audit.go b/backend/api/v1/audit.go
index c7d4582b1b..623affbfb5 100644
--- a/backend/api/v1/audit.go
+++ b/backend/api/v1/audit.go
@@ -55,8 +55,8 @@ func createAuditLog(ctx context.Context, request, response any, method string, s
if u, ok := ctx.Value(common.UserContextKey).(*store.UserMessage); ok {
user = common.FormatUserUID(u.ID)
} else {
- if loginResponse, ok := response.(*v1pb.LoginResponse); ok && loginResponse.User != nil {
- user = loginResponse.User.Name
+ if loginResponse, ok := response.(*v1pb.LoginResponse); ok {
+ user = loginResponse.GetUser().GetName()
}
}