From 6845bac9c61754c2ea04344f0a09c145b39f62e9 Mon Sep 17 00:00:00 2001 From: Adrian Veith Date: Wed, 21 Jun 2023 17:15:09 +0200 Subject: [PATCH] workaround for Issue #778 setting data to nil in line 386 crashes the front end app. Therefore I commented it out. This is not a perfect solution for the Issue #778 because we want the location data when `CameraUsesGeolocation` but better not to crash. --- src/ios/CDVCamera.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 6793da45b..c71a42bd2 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -406,7 +406,7 @@ - (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPic } [[self locationManager] startUpdatingLocation]; } - data = nil; + // data = nil; // this causes Issue #778 } } else if (pickerController.sourceType == UIImagePickerControllerSourceTypePhotoLibrary) { PHAsset* asset = [info objectForKey:@"UIImagePickerControllerPHAsset"]; @@ -659,7 +659,7 @@ - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingM NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType]; if ([mediaType isEqualToString:(NSString*)kUTTypeImage]) { [weakSelf resultForImage:cameraPicker.pictureOptions info:info completion:^(CDVPluginResult* res) { - if (![self usesGeolocation] || picker.sourceType != UIImagePickerControllerSourceTypeCamera) { + if (![weakSelf usesGeolocation] || picker.sourceType != UIImagePickerControllerSourceTypeCamera) { [weakSelf.commandDelegate sendPluginResult:res callbackId:cameraPicker.callbackId]; weakSelf.hasPendingOperation = NO; weakSelf.pickerController = nil;