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