From 0eb39fae9a4f11cff08fff72f6fc752689c43792 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 12 Jun 2026 09:44:43 +0200 Subject: [PATCH] fix(events): handle nil auth when building event doers ProjectUser.Create and friends are called with a nil auth in tests; the old interface-typed Doer just serialized as null, so a nil doer keeps that behavior (and maps to the system actor in the audit entry). --- pkg/models/users.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/models/users.go b/pkg/models/users.go index 51b6ede2a..84a7101da 100644 --- a/pkg/models/users.go +++ b/pkg/models/users.go @@ -27,6 +27,9 @@ import ( // flows acting on behalf of disabled accounts (e.g. user deletion), and the // event only needs the principal as it authenticated. func doerFromAuth(a web.Auth) *user.User { + if a == nil { + return nil + } if u, is := a.(*user.User); is { return u }