From fcf01a6039ed311a7299dda364d1fccb619eb1d9 Mon Sep 17 00:00:00 2001 From: Colin Axner Date: Mon, 7 Dec 2020 11:28:51 +0100 Subject: [PATCH] add back else clause Add back else clause after realizing the error check doesn't return after logging. --- read.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/read.go b/read.go index 3b35371..399a133 100644 --- a/read.go +++ b/read.go @@ -171,11 +171,12 @@ func updateTimelineCache(tl *localTimeline, reset bool) { postsInterfaces, err := tl.m.Get() if err != nil { log.Error("[READ] Unable to cache posts: %v", err) + } else { + castPosts := postsInterfaces.([]PublicPost) + tl.posts = &castPosts } - - castPosts := postsInterfaces.([]PublicPost) - tl.posts = &castPosts } + } func showLocalTimeline(app *App, w http.ResponseWriter, r *http.Request, page int, author, tag string) error {