appview: repo: fix potentially nil commit in branches #213

merged
opened by oppi.li targeting master from push-rtwrkkyllvkm

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

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 {