chore: Fix nil class error at bot endpoint (#1177)
This commit is contained in:
@@ -16,14 +16,16 @@ class Integrations::Facebook::DeliveryStatus
|
||||
end
|
||||
|
||||
def contact
|
||||
::ContactInbox.find_by(source_id: sender_id).contact
|
||||
::ContactInbox.find_by(source_id: sender_id)&.contact
|
||||
end
|
||||
|
||||
def conversation
|
||||
@conversation ||= ::Conversation.find_by(contact_id: contact.id)
|
||||
@conversation ||= ::Conversation.find_by(contact_id: contact.id) if contact.present?
|
||||
end
|
||||
|
||||
def update_message_status
|
||||
return unless conversation
|
||||
|
||||
conversation.user_last_seen_at = @params.at
|
||||
conversation.save!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user