Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2019-02-19 22:29:10 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2019-06-05 14:38:09 +0300
commit5a89bcc4dae55c40bdd926797aba5e3f0ada05ae (patch)
treee64a364634faf196a3c59d40b50c437761d513d0 /app/models/diff_note.rb
parentd9a761ed14ab5025626dee17faf1528c1264a1b0 (diff)
Avoid 500's when commit is not reachable
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r--app/models/diff_note.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb
index 1a87fc47c56..8221b7de2b6 100644
--- a/app/models/diff_note.rb
+++ b/app/models/diff_note.rb
@@ -77,7 +77,7 @@ class DiffNote < Note
end
def supports_suggestion?
- return false unless noteable.supports_suggestion? && on_text?
+ return false unless noteable&.supports_suggestion? && on_text?
# We don't want to trigger side-effects of `diff_file` call.
return false unless file = latest_diff_file
return false unless line = file.line_for_position(self.position)