Fix 500 in public activity page (#1901)

tokarchuk/v1.17
Ethan Koenig 8 years ago committed by Bo-Yi Wu
parent 9ddc35e343
commit afe1f1c4af
  1. 6
      routers/user/home.go

@ -55,9 +55,13 @@ func getDashboardContextUser(ctx *context.Context) *models.User {
// retrieveFeeds loads feeds for the specified user // retrieveFeeds loads feeds for the specified user
func retrieveFeeds(ctx *context.Context, user *models.User, includePrivate, isProfile bool) { 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{ actions, err := models.GetFeeds(models.GetFeedsOptions{
RequestedUser: user, RequestedUser: user,
RequestingUserID: ctx.User.ID, RequestingUserID: requestingID,
IncludePrivate: includePrivate, IncludePrivate: includePrivate,
OnlyPerformedBy: isProfile, OnlyPerformedBy: isProfile,
}) })

Loading…
Cancel
Save