forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: repo: fix potentially nil commit in branches

old knots will not attach a commit to a branch. sorting by commit time
fails in these responses.

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

oppi.li fc8938c5 6d3ed294

verified
Changed files
+2 -2
appview
repo
+2 -2
appview/repo/repo.go
···
if b.IsDefault {
return 1
}
-
if a.Commit != nil {
+
if a.Commit != nil && b.Commit != nil {
if a.Commit.Committer.When.Before(b.Commit.Committer.When) {
return 1
} else {
···
if b.IsDefault {
return 1
}
-
if a.Commit != nil {
+
if a.Commit != nil && b.Commit != nil {
if a.Commit.Committer.When.Before(b.Commit.Committer.When) {
return 1
} else {