summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-05 12:32:24 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-05 12:32:24 +0300
commitd602d5b1b05036788c67c13510c34725c68116ea (patch)
treef32deb970a43268839a23d8d68f77b1abf4b7554 /app/models/note.rb
parent02e859a23470d799a77963503687789d4a410a0c (diff)
downloadgitlab-ce-d602d5b1b05036788c67c13510c34725c68116ea.tar.gz
Fix find_diff for note when noteable is nil
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb2
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