From 0230ca839a2ec8debcbe4476c3deed8b422bf451 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Tue, 22 May 2018 12:24:14 +0200 Subject: Check if note's noteable is not nil when checking resolvability This can occur when a note is added to a commit and then this commit is deleted. --- app/models/concerns/resolvable_note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/concerns/resolvable_note.rb b/app/models/concerns/resolvable_note.rb index 668c5a079e3..4a0f8b92b3a 100644 --- a/app/models/concerns/resolvable_note.rb +++ b/app/models/concerns/resolvable_note.rb @@ -32,7 +32,7 @@ module ResolvableNote # Keep this method in sync with the `potentially_resolvable` scope def potentially_resolvable? - RESOLVABLE_TYPES.include?(self.class.name) && noteable.supports_resolvable_notes? + RESOLVABLE_TYPES.include?(self.class.name) && noteable&.supports_resolvable_notes? end # Keep this method in sync with the `resolvable` scope -- cgit v1.2.1