From 52a5a59ddbdacf891addd499f58635b6fed7beb9 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 15 Jan 2024 19:13:44 +0530 Subject: [PATCH] fix: Handle error if the Twillio attachment download fails to download (#8705) --- app/services/twilio/incoming_message_service.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/services/twilio/incoming_message_service.rb b/app/services/twilio/incoming_message_service.rb index ed69dfc69..f28192f4e 100644 --- a/app/services/twilio/incoming_message_service.rb +++ b/app/services/twilio/incoming_message_service.rb @@ -109,6 +109,8 @@ class Twilio::IncomingMessageService attachment_file = download_attachment_file + return if attachment_file.blank? + attachment = @message.attachments.new( account_id: @message.account_id, file_type: file_type(params[:MediaContentType0]) @@ -144,6 +146,7 @@ class Twilio::IncomingMessageService Down.download(params[:MediaUrl0]) else ChatwootExceptionTracker.new(error, account: @inbox.account).capture_exception + nil end end end