forked from tangled.org/core
this repo has no description

appview/db: handle nils

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li b3c2b81d 5df3d5df

verified
Changed files
+3 -3
appview
db
signup
+2 -2
appview/db/pulls.go
···
// 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)
}
}
···
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
}
+1 -1
appview/signup/signup.go
···
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
}