Skip to content

Commit d91730b

Browse files
rdu-megaharryyan1238
authored andcommitted
IOS-7932: Fix photo upload operation crash
1 parent 0cb960a commit d91730b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

iMEGA/Camera uploads/UploadManagers/ImageExportManager.m

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ - (void)exportImageAtURL:(NSURL *)imageURL dataTypeUTI:(NSString *)dataUTI toURL
7474

7575
- (NSOperationQueue *)exportQueueForDataUTI:(NSString *)dataUTI outputTypeUTI:(NSString *)outputUTI {
7676
NSOperationQueue *queue = self.generalExportOperationQueue;
77+
78+
if (dataUTI == nil) {
79+
return queue;
80+
}
81+
7782
if ([[UTType typeWithIdentifier:dataUTI] conformsToType:UTTypeHEIC]) {
7883
if (outputUTI.length == 0 || [dataUTI isEqualToString:outputUTI]) {
7984
queue = self.HEICExportOperationQueue;

iMEGA/Camera uploads/UploadOperations/PhotoUploadOperation.m

+6-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ - (void)exportImageAtURL:(NSURL *)URL dataUTI:(NSString *)dataUTI dataInfo:(NSDi
155155
}
156156

157157
- (BOOL)shouldConvertToJPGForUTI:(NSString *)dataUTI {
158-
return [CameraUploadManager shouldConvertHEICPhoto] && [[UTType typeWithIdentifier:dataUTI] conformsToType: UTTypeHEIC];
158+
if (dataUTI != nil) {
159+
UTType *type = [UTType typeWithIdentifier:dataUTI];
160+
return [CameraUploadManager shouldConvertHEICPhoto] && [type conformsToType: UTTypeHEIC];
161+
}
162+
163+
return false;
159164
}
160165

161166
- (UploadQueueType)uploadQueueType {

0 commit comments

Comments
 (0)