summaryrefslogtreecommitdiff
path: root/app/models/concerns/subscribable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/subscribable.rb')
-rw-r--r--app/models/concerns/subscribable.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/concerns/subscribable.rb b/app/models/concerns/subscribable.rb
index 274b38a7708..f478c8ede18 100644
--- a/app/models/concerns/subscribable.rb
+++ b/app/models/concerns/subscribable.rb
@@ -13,6 +13,8 @@ module Subscribable
end
def subscribed?(user, project = nil)
+ return false unless user
+
if subscription = subscriptions.find_by(user: user, project: project)
subscription.subscribed
else