minor fix on debug mode to prevent crashing

pull/560/head
Ryan Zhao 3 years ago
parent b4b6b24530
commit 7ee76bf9ca

@ -569,13 +569,13 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
TSAttachment *_Nullable linkPreviewAttachment =
[TSAttachment fetchObjectWithUniqueID:message.linkPreview.imageAttachmentId transaction:transaction];
if (!linkPreviewAttachment) {
OWSFailDebug(@"Could not load link preview image attachment.");
OWSLogDebug(@"Could not load link preview image attachment.");
} else if (!linkPreviewAttachment.isImage) {
OWSFailDebug(@"Link preview attachment isn't an image.");
OWSLogDebug(@"Link preview attachment isn't an image.");
} else if ([linkPreviewAttachment isKindOfClass:[TSAttachmentStream class]]) {
TSAttachmentStream *attachmentStream = (TSAttachmentStream *)linkPreviewAttachment;
if (!attachmentStream.isValidImage) {
OWSFailDebug(@"Link preview image attachment isn't valid.");
OWSLogDebug(@"Link preview image attachment isn't valid.");
} else {
self.linkPreviewAttachment = linkPreviewAttachment;
}

Loading…
Cancel
Save