summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-01 09:33:12 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-01 09:33:12 +0200
commit61833bcb7457d98800c0581b6d09406929057a54 (patch)
tree9ee03957ac896b368b98716795f38f8fc552d9dd
parentcc2484c3e61764adbb61d78c97148c41cf346cd1 (diff)
downloadgitlab-ce-61833bcb7457d98800c0581b6d09406929057a54.tar.gz
fix app crash if author is missing
-rw-r--r--app/observers/note_observer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/observers/note_observer.rb b/app/observers/note_observer.rb
index 3f6d1dfcb70..4ee9fadf4da 100644
--- a/app/observers/note_observer.rb
+++ b/app/observers/note_observer.rb
@@ -11,7 +11,9 @@ class NoteObserver < ActiveRecord::Observer
notify_team(note)
elsif note.notify_author
# Notify only author of resource
- Notify.delay.note_commit_email(note.commit_author.id, note.id)
+ if note.commit_author
+ Notify.delay.note_commit_email(note.commit_author.id, note.id)
+ end
else
# Otherwise ignore it
nil