Check page.nil? before page.wiki (#1535)
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user