Don't fail when a LegacyDiffNote didn't store the right diff
This commit is contained in:
parent
fbd75c35fd
commit
c5555c8a84
2 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ class LegacyDiffNote < Note
|
|||
end
|
||||
|
||||
def diff_line
|
||||
@diff_line ||= diff_file.line_for_line_code(self.line_code)
|
||||
@diff_line ||= diff_file.line_for_line_code(self.line_code) if diff_file
|
||||
end
|
||||
|
||||
def for_line?(line)
|
||||
|
@ -55,7 +55,7 @@ class LegacyDiffNote < Note
|
|||
def active?
|
||||
return @active if defined?(@active)
|
||||
return true if for_commit?
|
||||
return true unless self.diff
|
||||
return true unless diff_line
|
||||
return false unless noteable
|
||||
|
||||
noteable_diff = find_noteable_diff
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- if @note.diff_note?
|
||||
- if @note.diff_note? && @note.diff_file
|
||||
%p.details
|
||||
New comment on diff for
|
||||
= link_to @note.diff_file.file_path, @target_url
|
||||
|
|
Loading…
Reference in a new issue