Fixed: error when previewing a new wiki page (#1292) introduced in r1415.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1445 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-05-23 16:29:40 +00:00
parent e02e047dd4
commit 9d4e71adf3
2 changed files with 13 additions and 1 deletions
+2 -1
View File
@@ -162,7 +162,8 @@ class WikiController < ApplicationController
def preview
page = @wiki.find_page(params[:page])
return render_403 unless editable?(page)
# page is nil when previewing a new page
return render_403 unless page.nil? || editable?(page)
@attachements = page.attachments if page
@text = params[:content][:text]
render :partial => 'common/preview'