From 2cdca0299ce8cc0e1a49a4c2ba5faafc066149ff Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 30 Aug 2018 20:49:31 -0600 Subject: [PATCH] show generic file icon for invalid GIF --- .../ViewControllers/ConversationView/ConversationViewItem.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m index cb05b04a3..2eb633997 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m @@ -481,6 +481,12 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType) } else if ([self.attachmentStream isAnimated] || [self.attachmentStream isImage] || [self.attachmentStream isVideo]) { if ([self.attachmentStream isAnimated]) { + if (![self.attachmentStream isValidImage]) { + DDLogWarn(@"Treating invalid image as generic attachment."); + self.messageCellType = OWSMessageCellType_GenericAttachment; + return; + } + self.messageCellType = OWSMessageCellType_AnimatedImage; } else if ([self.attachmentStream isImage]) { if (![self.attachmentStream isValidImage]) {