From 2b1d45d437823ed70f2848e52d7bda0ef24b538d Mon Sep 17 00:00:00 2001 From: Timur Nuriev Date: Fri, 25 Oct 2019 14:47:48 +0400 Subject: [PATCH] fixed crash when the user selected a picture (tested device iPad pro, ios 13.1.3, app - AIMSMobile / IHF_App) --- Source/Models/DBAttachment.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Models/DBAttachment.m b/Source/Models/DBAttachment.m index dac69fd..8a6d59c 100644 --- a/Source/Models/DBAttachment.m +++ b/Source/Models/DBAttachment.m @@ -184,10 +184,12 @@ - (void)loadOriginalImageWithCompletion:(void(^)(UIImage *resultImage))completio switch (self.sourceType) { case DBAttachmentSourceTypePHAsset: if (completion) { + PHImageRequestOptions *options = [PHImageRequestOptions new]; + options.synchronous = YES; [[PHImageManager defaultManager] requestImageForAsset:self.photoAsset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault - options:nil + options:options resultHandler:^(UIImage *result, NSDictionary *info) { completion(result); }];