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).
This commit is contained in:
kolaente 2026-06-12 09:44:43 +02:00
parent 88fd327f75
commit a56ae39b36
1 changed files with 3 additions and 0 deletions

View File

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