chore: Fix nil class error at bot endpoint (#1177)
This commit is contained in:
parent
85ae6d92b9
commit
5ac093fca2
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue