Commit 2f8505a5 authored by azul's avatar azul

fix: check for page before testing page_policy

parent e51e6a04
......@@ -23,7 +23,7 @@ class PostPolicy < ApplicationPolicy
protected
def admin?
page_policy.admin?
page && page_policy.admin?
end
def comment_by_visitor_on_public_page?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment