summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-28 16:00:19 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-28 16:00:19 +0200
commit583bfac5f57d3d5c599c8d5d1c422e1bf7b9f265 (patch)
tree5e2fe5b484f6816ff05267f64af2071d9da4ba1a /app
parent5ad4be295f68310bbd031585bbf6e203084f325e (diff)
downloadgitlab-ce-583bfac5f57d3d5c599c8d5d1c422e1bf7b9f265.tar.gz
Fix Note notification for entities without assignee
Diffstat (limited to 'app')
-rw-r--r--app/services/notification_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 3c3ee39cd7b..486aef1d36c 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -109,7 +109,10 @@ class NotificationService
recipients = [note.commit_author]
else
opts.merge!(noteable_id: note.noteable_id)
- recipients = [note.noteable.try(:author), note.noteable.try(:assignee)]
+ target = note.noteable
+ recipients = []
+ recipients << target.assignee if target.respond_to?(:assignee)
+ recipients << target.author if target.respond_to?(:author)
end
# Get users who left comment in thread