From 4a70f8dc0fe854917592f892f131bc3b979d0f34 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 24 Nov 2018 17:33:11 -0600 Subject: [PATCH] only process attachments if they exist --- .../src/Devices/OWSRecordTranscriptJob.m | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m index 16b22acac..fdfbb40ff 100644 --- a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m +++ b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m @@ -175,14 +175,16 @@ NS_ASSUME_NONNULL_BEGIN [self.readReceiptManager applyEarlyReadReceiptsForOutgoingMessageFromLinkedDevice:outgoingMessage transaction:transaction]; - [self.attachmentDownloads - downloadAttachmentsForMessage:outgoingMessage - transaction:transaction - success:attachmentHandler - failure:^(NSError *error) { - OWSLogError( - @"failed to fetch transcripts attachments for message: %@", outgoingMessage); - }]; + if (outgoingMessage.hasAttachments) { + [self.attachmentDownloads + downloadAttachmentsForMessage:outgoingMessage + transaction:transaction + success:attachmentHandler + failure:^(NSError *error) { + OWSLogError( + @"failed to fetch transcripts attachments for message: %@", outgoingMessage); + }]; + } } @end