fix: ping func

This commit is contained in:
deepzz0
2021-04-28 15:05:37 +08:00
parent c5a3bd6eab
commit 897b05d071
4 changed files with 15 additions and 4 deletions

3
pkg/cache/cache.go vendored
View File

@@ -469,7 +469,8 @@ func (c *Cache) loadOrInit() error {
if i > 0 {
v.Prev = articles[i-1]
}
if articles[i+1].ID >= blogapp.General.StartID {
if i < len(articles)-1 &&
articles[i+1].ID >= blogapp.General.StartID {
v.Next = articles[i+1]
}
c.readdArticle(v, false)