Fix “Invalid media attachments” crash.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent c758f85cc8
commit 6276dcb34c

@ -103,8 +103,7 @@ NS_ASSUME_NONNULL_BEGIN
NSData *fileData = [NSData dataWithContentsOfURL:[self.attachment mediaURL]];
if (!fileData) {
DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]);
OWSAssert(0);
return nil;
return [UIView new];
}
FLAnimatedImage *animatedGif = [FLAnimatedImage animatedImageWithGIFData:fileData];
FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];

@ -75,8 +75,7 @@ NS_ASSUME_NONNULL_BEGIN
UIImage *image = self.attachment.image;
if (!image) {
DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]);
OWSAssert(0);
return nil;
return [UIView new];
}
CGSize size = [self mediaViewDisplaySize];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

@ -227,8 +227,7 @@ NS_ASSUME_NONNULL_BEGIN
UIImage *image = self.attachment.image;
if (!image) {
DDLogError(@"%@ Could not load image: %@", [self tag], [self.attachment mediaURL]);
OWSAssert(0);
return nil;
return [UIView new];
}
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.contentMode = UIViewContentModeScaleAspectFill;

Loading…
Cancel
Save