Handle missing commentable for user_is_commentable_author? check (#5336) [deploy]
This commit is contained in:
parent
cb98b3b510
commit
c64bfdb652
1 changed files with 1 additions and 1 deletions
|
|
@ -64,6 +64,6 @@ class CommentPolicy < ApplicationPolicy
|
|||
end
|
||||
|
||||
def user_is_commentable_author?
|
||||
record.commentable.user_id == user.id
|
||||
record.commentable.present? && record.commentable.user_id == user.id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue