mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: One-by-off error in topic show action (#13183)
The not found condition did not work for topics with chunk_size posts, because it considered it has two pages, but it only has one.
This commit is contained in:
@ -128,7 +128,7 @@ class TopicsController < ApplicationController
|
||||
end
|
||||
|
||||
page = params[:page]
|
||||
if (page < 0) || ((page - 1) * @topic_view.chunk_size > @topic_view.topic.highest_post_number)
|
||||
if (page < 0) || ((page - 1) * @topic_view.chunk_size >= @topic_view.topic.highest_post_number)
|
||||
raise Discourse::NotFound
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user