From 9da1b4ae2998c1a824914cdfd4cf6c9290434e9c Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Tue, 14 Apr 2026 00:20:37 +0900 Subject: [PATCH] appview/models: handle when targetRepo is nil Signed-off-by: Seongmin Lee --- appview/models/pull.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/appview/models/pull.go b/appview/models/pull.go index 4d127069..f17f6a21 100644 --- a/appview/models/pull.go +++ b/appview/models/pull.go @@ -97,11 +97,13 @@ func (p Pull) AsRecord() tangled.RepoPull { references[i] = string(uri) } - var targetRepoAt, targetRepoDid string + var targetRepoAt, targetRepoDid *string + targetRepoAt = new(string) + *targetRepoAt = p.RepoAt.String() if p.Repo != nil && p.Repo.RepoDid != "" { - targetRepoDid = p.Repo.RepoDid + targetRepoDid = new(string) + *targetRepoDid = p.Repo.RepoDid } - targetRepoAt = p.RepoAt.String() rounds := make([]*tangled.RepoPull_Round, len(p.Submissions)) for i, submission := range p.Submissions { @@ -121,8 +123,8 @@ func (p Pull) AsRecord() tangled.RepoPull { References: references, CreatedAt: p.Created.Format(time.RFC3339), Target: &tangled.RepoPull_Target{ - Repo: &targetRepoAt, - RepoDid: &targetRepoDid, + Repo: targetRepoAt, + RepoDid: targetRepoDid, Branch: p.TargetBranch, }, Rounds: rounds, -- 2.51.2