Fix loadRepository error when access user dashboard (#31719)

(cherry picked from commit 7b388630ecb4537f9bb04e55cbb10eb7cf83b9c5)
This commit is contained in:
yp05327
2024-08-04 10:14:34 +02:00
committed by Earl Warren
parent 7850fa30a5
commit 2be49a3745
+4
View File
@@ -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)