From 97ae43126bce6765a1d1b0094f2863b29bc6111f Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Mon, 12 May 2014 15:50:31 +1000
Subject: [PATCH] BUGFIX: 500 error on missing category

---
 app/controllers/list_controller.rb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb
index 1c0d63522..acc54d954 100644
--- a/app/controllers/list_controller.rb
+++ b/app/controllers/list_controller.rb
@@ -252,11 +252,10 @@ class ListController < ApplicationController
     end
 
     @category = Category.query_category(slug_or_id, parent_category_id)
+    raise Discourse::NotFound.new if !@category
+
     @description_meta = @category.description
-
     guardian.ensure_can_see!(@category)
-
-    raise Discourse::NotFound.new if @category.blank?
   end
 
   def build_topic_list_options