From 2be49a37453e0668840a40de59f920c15cad83ef Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 29 Jul 2024 15:51:02 +0900 Subject: [PATCH] Fix loadRepository error when access user dashboard (#31719) (cherry picked from commit 7b388630ecb4537f9bb04e55cbb10eb7cf83b9c5) --- models/git/commit_status.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/git/commit_status.go b/models/git/commit_status.go index 76870f9eb1..422cf0b4ee 100644 --- a/models/git/commit_status.go +++ b/models/git/commit_status.go @@ -181,6 +181,10 @@ func (status *CommitStatus) LocaleString(lang translation.Locale) string { // HideActionsURL set `TargetURL` to an empty string if the status comes from Gitea Actions func (status *CommitStatus) HideActionsURL(ctx context.Context) { + if status.RepoID == 0 { + return + } + if status.Repo == nil { if err := status.loadRepository(ctx); err != nil { log.Error("loadRepository: %v", err)