summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-06-08 04:48:49 -0400
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-06-08 03:48:49 -0500
commitafe1f1c4af079ff564c67552a4e559409712c11b (patch)
treec201900d68de55ec6132f5422d0f5944450e08b6 /routers
parent9ddc35e343d6789df694b64e86b52183ce077530 (diff)
downloadgitea-afe1f1c4af079ff564c67552a4e559409712c11b.tar.gz
gitea-afe1f1c4af079ff564c67552a4e559409712c11b.zip
Fix 500 in public activity page (#1901)
Diffstat (limited to 'routers')
-rw-r--r--routers/user/home.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 7f6396ebd1..9ff03cf04f 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -55,9 +55,13 @@ func getDashboardContextUser(ctx *context.Context) *models.User {
// retrieveFeeds loads feeds for the specified user
func retrieveFeeds(ctx *context.Context, user *models.User, includePrivate, isProfile bool) {
+ var requestingID int64
+ if ctx.User != nil {
+ requestingID = ctx.User.ID
+ }
actions, err := models.GetFeeds(models.GetFeedsOptions{
RequestedUser: user,
- RequestingUserID: ctx.User.ID,
+ RequestingUserID: requestingID,
IncludePrivate: includePrivate,
OnlyPerformedBy: isProfile,
})