diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-05 12:32:24 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-05 12:32:24 +0300 |
commit | d602d5b1b05036788c67c13510c34725c68116ea (patch) | |
tree | f32deb970a43268839a23d8d68f77b1abf4b7554 | |
parent | 02e859a23470d799a77963503687789d4a410a0c (diff) | |
download | gitlab-ce-d602d5b1b05036788c67c13510c34725c68116ea.tar.gz |
Fix find_diff for note when noteable is nil
-rw-r--r-- | app/models/note.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 697c9d03a93..b3b9bd760ee 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -71,7 +71,7 @@ class Note < ActiveRecord::Base end def find_diff - return nil unless noteable.diffs.present? + return nil unless noteable && noteable.diffs.present? @diff ||= noteable.diffs.find do |d| Digest::SHA1.hexdigest(d.new_path) == diff_file_index if d.new_path |