mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix “Invalid media attachments” crash.
// FREEBIE
This commit is contained in:
parent
c758f85cc8
commit
6276dcb34c
3 changed files with 3 additions and 6 deletions
|
@ -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…
Reference in a new issue