From 61833bcb7457d98800c0581b6d09406929057a54 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 1 Feb 2013 09:33:12 +0200 Subject: [PATCH] fix app crash if author is missing --- app/observers/note_observer.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/observers/note_observer.rb b/app/observers/note_observer.rb index 3f6d1dfc..4ee9fadf 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