Skip to content
Snippets Groups Projects
Commit d602d5b1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix find_diff for note when noteable is nil

parent 02e859a2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment