Prevent page variable being lower than 0

This commit is contained in:
Svallinn 2021-03-24 04:46:51 +00:00
parent 37ad62e93d
commit c972647ae7
No known key found for this signature in database
GPG Key ID: 09FB527F34037CCA

View File

@ -2521,7 +2521,7 @@ get "/api/v1/channels/search/:ucid" do |env|
query ||= ""
page = env.params.query["page"]?.try &.to_i?
page ||= 1
page = 1 if !page || page <= 0
count, search_results = channel_search(query, page, ucid)
JSON.build do |json|