From 5a89bcc4dae55c40bdd926797aba5e3f0ada05ae Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 19 Feb 2019 16:29:10 -0300 Subject: Avoid 500's when commit is not reachable --- app/models/diff_note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/diff_note.rb') 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) -- cgit v1.2.1