posts: fix error on post index page when search count times out in safe mode

Fix a nil deference error on the post index page. This happened when
performing a single tag search in safe mode and calculating the number
of search results timed out.
This commit is contained in:
evazion
2022-05-02 22:03:33 -05:00
parent 8d9e53da2b
commit 1a89071f2d
3 changed files with 11 additions and 1 deletions

View File

@@ -201,6 +201,7 @@ class PostQuery
end
concerning :CountMethods do
# @return [Integer, nil] The number of posts returned by the search, or nil on timeout.
def post_count
@post_count ||= fast_count
end