show generic file icon for invalid GIF

pull/1/head
Michael Kirk 7 years ago
parent d1dead0580
commit 2cdca0299c

@ -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]) {

Loading…
Cancel
Save