From a3dce9afd73957b48f62b10e9f87f4b62d340a99 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 20 May 2013 17:32:53 +1000 Subject: [PATCH] don't error out on not posts if its a json request --- app/controllers/topics_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index 8617ab91bd3..67f9b9d3eda 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -28,7 +28,7 @@ class TopicsController < ApplicationController opts = params.slice(:username_filters, :best_of, :page, :post_number, :posts_before, :posts_after, :best) @topic_view = TopicView.new(params[:id] || params[:topic_id], current_user, opts) - raise Discourse::NotFound unless @topic_view.posts.present? + raise Discourse::NotFound unless @topic_view.posts.present? || (request.format && request.format.json?) anonymous_etag(@topic_view.topic) do redirect_to_correct_topic && return if slugs_do_not_match