Fix run list broken when trigger user deleted (#24706) (#24709)

Backport #24706 by @lunny

Fix #24682

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 2fea93b2d3)
This commit is contained in:
Giteabot 2023-05-14 04:55:58 -04:00 committed by Earl Warren
parent e12f550fed
commit f9bf040a5a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -45,6 +45,9 @@ func (runs RunList) LoadTriggerUser(ctx context.Context) error {
run.TriggerUser = user_model.NewActionsUser()
} else {
run.TriggerUser = users[run.TriggerUserID]
if run.TriggerUser == nil {
run.TriggerUser = user_model.NewGhostUser()
}
}
}
return nil