mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Don't error out on nested categories index page param (#29273)
We're expecting the page param to be something that neatly coerces into an integer. If we receive something like a nested parameter, this will blow up. (I'm sure there are other examples as well.) This commit falls back to a page value of 1 if the coercion fails.
This commit is contained in:
@ -620,7 +620,7 @@ class CategoriesController < ApplicationController
|
||||
include_topics: include_topics,
|
||||
include_subcategories: include_subcategories,
|
||||
tag: params[:tag],
|
||||
page: params[:page].to_i,
|
||||
page: params[:page].try(:to_i) || 1,
|
||||
}
|
||||
|
||||
@category_list = CategoryList.new(guardian, category_options)
|
||||
|
Reference in New Issue
Block a user