diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index c2626eb96..e4eaf680d 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -21,7 +21,7 @@
- <% if @topic_view.posts.length > 0 && @topic_view.prev_page %> + <% if @topic_view.prev_page %> <%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev' %> <% end %> <% if @topic_view.next_page %> diff --git a/lib/topic_view.rb b/lib/topic_view.rb index d961a5388..2aa0ad3cb 100644 --- a/lib/topic_view.rb +++ b/lib/topic_view.rb @@ -60,7 +60,7 @@ class TopicView end def prev_page - if @page && @page > 1 + if @page && @page > 1 && posts.length > 0 @page - 1 else nil