Skip to content

Commit

Permalink
Merge pull request SpinaCMS#152 from arlyxiao/master
Browse files Browse the repository at this point in the history
Catch error when page is nil
  • Loading branch information
Bram Jetten committed May 31, 2016
2 parents 842bf47 + ed59493 commit f94008f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/spina/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def spina_request_path
end

def current_user_can_view_page?
raise ActiveRecord::RecordNotFound unless page.live? || current_user.present?
raise ActiveRecord::RecordNotFound if page.nil? || !page.live?

current_user.present?
end

def should_skip_to_first_child?
Expand Down

0 comments on commit f94008f

Please sign in to comment.