Commit d602d5b1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix find_diff for note when noteable is nil

parent 02e859a2
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment