mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Merge pull request #3857 from gdpelican/fix-for-untopiced-posts
Don't error on posts#latest if a post does not have a topic
This commit is contained in:
@ -42,7 +42,7 @@ class PostsController < ApplicationController
|
||||
.limit(50)
|
||||
# Remove posts the user doesn't have permission to see
|
||||
# This isn't leaking any information we weren't already through the post ID numbers
|
||||
posts = posts.reject { |post| !guardian.can_see?(post) }
|
||||
posts = posts.reject { |post| !guardian.can_see?(post) || post.topic.blank? }
|
||||
counts = PostAction.counts_for(posts, current_user)
|
||||
|
||||
respond_to do |format|
|
||||
|
Reference in New Issue
Block a user