appview: handle deleted repos in profile timeline #562

merged
opened by oppi.li targeting master from push-nupxprsykpzq
Changed files
+8 -4
appview
+8 -4
appview/db/issues.go
··· 359 repoMap[string(repos[i].RepoAt())] = &repos[i] 360 } 361 362 - for issueAt := range issueMap { 363 - i := issueMap[issueAt] 364 - r := repoMap[string(i.RepoAt)] 365 - i.Repo = r 366 } 367 368 // collect comments
··· 359 repoMap[string(repos[i].RepoAt())] = &repos[i] 360 } 361 362 + for issueAt, i := range issueMap { 363 + if r, ok := repoMap[string(i.RepoAt)]; ok { 364 + i.Repo = r 365 + } else { 366 + // do not show up the issue if the repo is deleted 367 + // TODO: foreign key where? 368 + delete(issueMap, issueAt) 369 + } 370 } 371 372 // collect comments