FIX: handle invalid tags

This commit is contained in:
Arpit Jalan
2018-05-17 19:32:15 +05:30
parent b74c108c09
commit 9532d9a555
2 changed files with 24 additions and 4 deletions

View File

@@ -277,10 +277,14 @@ class TagsController < ::ApplicationController
def construct_url_with(action, opts)
method = url_method(opts)
url = if action == :prev
public_send(method, opts.merge(prev_page_params(opts)))
else # :next
public_send(method, opts.merge(next_page_params(opts)))
begin
url = if action == :prev
public_send(method, opts.merge(prev_page_params(opts)))
else # :next
public_send(method, opts.merge(next_page_params(opts)))
end
rescue
raise Discourse::NotFound
end
url.sub('.json?', '?')
end