warn if missing user option record

This commit is contained in:
Sam 2018-01-12 15:43:40 +11:00
parent 988b13ac77
commit 5bf116e719
1 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,12 @@ class NotificationEmailer
end end
def enqueue_private(type, delay = private_delay) def enqueue_private(type, delay = private_delay)
if notification.user.user_option.nil?
Rails.logger.warn("Missing user option record for user id: #{notification.user.id}")
return
end
return unless notification.user.user_option.email_private_messages? return unless notification.user.user_option.email_private_messages?
perform_enqueue(type, delay) perform_enqueue(type, delay)
end end