summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-06-05 13:33:16 +0000
committerLin Jen-Shin <godfat@godfat.org>2019-06-05 13:33:16 +0000
commit09f482ba41b9dd021f1dc43a0ddf4ca3814bfc6b (patch)
tree363e0e4c953dfe10b7b2d63859cf31297ce9e757 /app
parent202e525119188721004c4a1eb6be18c9cf7a6f5e (diff)
parent5a89bcc4dae55c40bdd926797aba5e3f0ada05ae (diff)
downloadgitlab-ce-09f482ba41b9dd021f1dc43a0ddf4ca3814bfc6b.tar.gz
Merge branch 'osw-avoid-500-on-suggestions-check' into 'master'
Avoid 500 when evaluating `DiffNote#supports_suggestion?` and commit is not reachable Closes #57570 See merge request gitlab-org/gitlab-ce!25408
Diffstat (limited to 'app')
-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)