fix debug assertion failure crash

pull/245/head
Ryan ZHAO 5 years ago
parent 9b527424e6
commit 9948170fe6

@ -797,12 +797,14 @@ class MediaGallery: NSObject, MediaGalleryDataSource, MediaTileViewControllerDel
func buildGalleryItem(attachment: TSAttachment, transaction: YapDatabaseReadTransaction) -> MediaGalleryItem? { func buildGalleryItem(attachment: TSAttachment, transaction: YapDatabaseReadTransaction) -> MediaGalleryItem? {
guard let attachmentStream = attachment as? TSAttachmentStream else { guard let attachmentStream = attachment as? TSAttachmentStream else {
owsFailDebug("gallery doesn't yet support showing undownloaded attachments") // Avoid crash on dev mode
// owsFailDebug("gallery doesn't yet support showing undownloaded attachments")
return nil return nil
} }
guard let message = attachmentStream.fetchAlbumMessage(with: transaction) else { guard let message = attachmentStream.fetchAlbumMessage(with: transaction) else {
owsFailDebug("message was unexpectedly nil") // Avoid crash on dev mode
// owsFailDebug("message was unexpectedly nil")
return nil return nil
} }

@ -502,7 +502,8 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
- (CGSize)imageSize - (CGSize)imageSize
{ {
OWSAssertDebug(self.shouldHaveImageSize); // Avoid crash in dev mode
// OWSAssertDebug(self.shouldHaveImageSize);
@synchronized(self) @synchronized(self)
{ {

Loading…
Cancel
Save