You can't call post.person when post is nil. We should probably just reject and delete the invalid notifications in the controller, keeping them in the view is aggravating
This commit is contained in:
parent
22c4ebd6de
commit
736783abd7
2 changed files with 2 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ module NotificationsHelper
|
|||
if post
|
||||
"#{translation(target_type, post.person.name)} #{link_to t('notifications.post'), object_path(post)}".html_safe
|
||||
else
|
||||
"#{translation(target_type, post.person.name)} #{t('notifications.deleted')} #{t('notifications.post')}"
|
||||
t('notifications.also_commented_deleted')
|
||||
end
|
||||
else
|
||||
end
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ en:
|
|||
mentioned: "has mentioned you in their"
|
||||
post: "post"
|
||||
deleted: "deleted"
|
||||
also_commented_deleted: "commented on a deleted post"
|
||||
index:
|
||||
notifications: "Notifications"
|
||||
mark_all_as_read: "Mark All as Read"
|
||||
|
|
|
|||
Loading…
Reference in a new issue