From 8445de2242499bd5754cd8f4dc6983a10896d2e1 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Fri, 27 Mar 2026 18:55:23 +0900 Subject: [PATCH] appview/indexer/repos: check `RepoStats` nullability Fix appview segfault on new repo creation. `RepoStats` can be empty. It is recommended to check it before accessing. Signed-off-by: Seongmin Lee --- appview/indexer/repos/indexer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appview/indexer/repos/indexer.go b/appview/indexer/repos/indexer.go index 3e21f8aa..e78388dd 100644 --- a/appview/indexer/repos/indexer.go +++ b/appview/indexer/repos/indexer.go @@ -241,6 +241,10 @@ type repoData struct { } func makeRepoData(repo *models.Repo) *repoData { + var language string + if repo.RepoStats != nil { + language = repo.RepoStats.Language + } return &repoData{ ID: repo.Id, RepoAt: repo.RepoAt().String(), @@ -252,7 +256,7 @@ func makeRepoData(repo *models.Repo) *repoData { Topics: repo.Topics, TopicsExact: repo.Topics, Knot: repo.Knot, - Language: repo.RepoStats.Language, + Language: language, } } -- 2.51.2