diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb index b0f9efcf318..ec901ddb638 100644 --- a/app/controllers/list_controller.rb +++ b/app/controllers/list_controller.rb @@ -79,8 +79,8 @@ class ListController < ApplicationController # Note the first is the default and we don't add a title if (filter.to_s != current_homepage) && use_crawler_layout? filter_title = I18n.t("js.filters.#{filter.to_s}.title", count: 0) - if list_opts[:category] - @title = I18n.t('js.filters.with_category', filter: filter_title, category: Category.find(list_opts[:category]).name) + if list_opts[:category] && @category + @title = I18n.t('js.filters.with_category', filter: filter_title, category: @category.name) else @title = I18n.t('js.filters.with_topics', filter: filter_title) end