summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-05-22 12:24:14 +0200
committerJan Provaznik <jprovaznik@gitlab.com>2018-05-23 16:58:40 +0200
commit0230ca839a2ec8debcbe4476c3deed8b422bf451 (patch)
tree5a4435de36faf3ef696cf855491367097e2e30e5 /app/models
parent4d674bd38c8a3568f6e1295c25c902ef10151aef (diff)
downloadgitlab-ce-0230ca839a2ec8debcbe4476c3deed8b422bf451.tar.gz
Check if note's noteable is not nil when checking resolvabilityjprovazn-fix-resolvable
This can occur when a note is added to a commit and then this commit is deleted.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/resolvable_note.rb2
1 files changed, 1 insertions, 1 deletions
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