Check page.nil? before page.wiki (#1535)

This commit is contained in:
Watal M. Iwasaki
2020-04-02 18:07:33 +09:00
committed by GitHub
parent edc7d0b50b
commit 0cb303f09f
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -413,8 +413,8 @@ module Precious
@page = wikip.page
@page_num = [params[:page_num].to_i, 1].max
@max_count = settings.wiki_options.fetch(:pagination_count, 10)
@wiki = @page.wiki
unless @page.nil?
@wiki = @page.wiki
@versions = @page.versions(
per_page: @max_count,
page_num: @page_num,
+8
View File
@@ -647,6 +647,14 @@ EOF
assert_match /meta name="robots" content="noindex, nofollow"/, last_response.body
end
test 'history/NO-EXIST redirects to Home' do
get '/gollum/history/NO-EXIST'
follow_redirect!
assert_equal last_request.fullpath, '/'
# redirect again from / to /Home
assert_equal last_response.status, 302
end
def app
Precious::App
end