diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index e8458a937..7b0ef659f 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -8,7 +8,12 @@ module NotificationsHelper when 'new_request' translation when 'comment_on_post' - "#{translation} #{link_to t('notifications.post'), object_path(Comment.first(:id => note.target_id).post)}".html_safe + comment = Comment.first(:id => note.target_id) + if comment + "#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe + else + "#{translation} #{t('notifications.deleted')} #{t('notifications.post')}" + end else end end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 81542c93d..c4803b85f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -188,6 +188,7 @@ en: new_request: "offered to share with you." comment_on_post: "commented on your" post: 'post' + deleted: 'deleted' index: notifications: "Notifications" users: