diff --git a/models/repo/repo_list.go b/models/repo/repo_list.go index 92b9c15b4bd8d..de6b8cdf84a29 100644 --- a/models/repo/repo_list.go +++ b/models/repo/repo_list.go @@ -84,7 +84,11 @@ func (repos RepositoryList) LoadAttributes(ctx context.Context) error { return fmt.Errorf("find users: %w", err) } for i := range repos { - repos[i].Owner = users[repos[i].OwnerID] + if users[repos[i].OwnerID] != nil { + repos[i].Owner = users[repos[i].OwnerID] + } else { + repos[i].Owner = user_model.NewGhostUser() + } } // Load primary language. diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index b311472b43ed2..b5872d487b491 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -7,9 +7,15 @@ {{if $avatar}} {{$avatar}} {{end}} - - {{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} - + {{if not .Owner.IsGhost}} + + {{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} + + {{else}} + + {{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} + + {{end}}