From b3c2b81d8537135a44ca75274fbc23e6d0c9068c Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Wed, 1 Oct 2025 11:56:51 +0100 Subject: [PATCH] appview/db: handle nils Signed-off-by: oppiliappan --- appview/db/pulls.go | 4 ++-- appview/signup/signup.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appview/db/pulls.go b/appview/db/pulls.go index 409c615d..cacb6c42 100644 --- a/appview/db/pulls.go +++ b/appview/db/pulls.go @@ -246,7 +246,7 @@ func GetPullsWithLimit(e Execer, limit int, filters ...filter) ([]*models.Pull, // collect pull source for all pulls that need it var sourceAts []syntax.ATURI for _, p := range pulls { - if p.PullSource.RepoAt != nil { + if p.PullSource != nil && p.PullSource.RepoAt != nil { sourceAts = append(sourceAts, *p.PullSource.RepoAt) } } @@ -259,7 +259,7 @@ func GetPullsWithLimit(e Execer, limit int, filters ...filter) ([]*models.Pull, sourceRepoMap[r.RepoAt()] = &r } for _, p := range pulls { - if p.PullSource.RepoAt != nil { + if p.PullSource != nil && p.PullSource.RepoAt != nil { if sourceRepo, ok := sourceRepoMap[*p.PullSource.RepoAt]; ok { p.PullSource.Repo = sourceRepo } diff --git a/appview/signup/signup.go b/appview/signup/signup.go index f7a3e78f..c96b6b9a 100644 --- a/appview/signup/signup.go +++ b/appview/signup/signup.go @@ -133,7 +133,7 @@ func (s *Signup) signup(w http.ResponseWriter, r *http.Request) { noticeId := "signup-msg" if err := s.validateCaptcha(cfToken, r); err != nil { - s.l.Warn("turnstile validation failed", "error", err) + s.l.Warn("turnstile validation failed", "error", err, "email", emailId) s.pages.Notice(w, noticeId, "Captcha validation failed.") return } -- 2.51.2