Commit d602d5b1b05036788c67c13510c34725c68116ea
1 parent
02e859a2
Exists in
master
and in
4 other branches
Fix find_diff for note when noteable is nil
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/note.rb
| ... | ... | @@ -71,7 +71,7 @@ class Note < ActiveRecord::Base |
| 71 | 71 | end |
| 72 | 72 | |
| 73 | 73 | def find_diff |
| 74 | - return nil unless noteable.diffs.present? | |
| 74 | + return nil unless noteable && noteable.diffs.present? | |
| 75 | 75 | |
| 76 | 76 | @diff ||= noteable.diffs.find do |d| |
| 77 | 77 | Digest::SHA1.hexdigest(d.new_path) == diff_file_index if d.new_path | ... | ... |