diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-15 23:49:24 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-15 23:49:24 +0000 |
commit | 4f25e3178b2eaa71f312e80ca183358b350c97d6 (patch) | |
tree | 054d7a2d19a5705c1b9ee253c438218c194d7650 /app | |
parent | c676283b7aa5428949d81aba2bd248102e600f1b (diff) | |
parent | 34653c1e8be0be230943c39713da424a9e22d15b (diff) | |
download | gitlab-ce-4f25e3178b2eaa71f312e80ca183358b350c97d6.tar.gz |
Merge branch 'legacy-diff-notes-are-dumb' into 'master'
Don't fail when a LegacyDiffNote didn't store the right diff
Fixes https://sentry.gitlap.com/gitlab/gitlabcom/issues/8865/ and https://sentry.gitlap.com/gitlab/gitlabcom/issues/8754/
See merge request !5287
Diffstat (limited to 'app')
-rw-r--r-- | app/models/legacy_diff_note.rb | 4 | ||||
-rw-r--r-- | app/views/notify/note_merge_request_email.html.haml | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb index 790dfd4d480..04a651d50ab 100644 --- a/app/models/legacy_diff_note.rb +++ b/app/models/legacy_diff_note.rb @@ -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 diff --git a/app/views/notify/note_merge_request_email.html.haml b/app/views/notify/note_merge_request_email.html.haml index 35c4b862bb7..ea7e3d199fd 100644 --- a/app/views/notify/note_merge_request_email.html.haml +++ b/app/views/notify/note_merge_request_email.html.haml @@ -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 |