diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 6793da45b..d86254834 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -631,12 +631,17 @@ - (void)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info comp - (CDVPluginResult*)resultForVideo:(NSDictionary*)info { - NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString]; - // On iOS 13 the movie path becomes inaccessible, create and return a copy - if (IsAtLeastiOSVersion(@"13.0")) { - moviePath = [self createTmpVideo:[[info objectForKey:UIImagePickerControllerMediaURL] path]]; + @try { + NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString]; + // On iOS 13 the movie path becomes inaccessible, create and return a copy + if (IsAtLeastiOSVersion(@"13.0")) { + moviePath = [self createTmpVideo:[[info objectForKey:UIImagePickerControllerMediaURL] path]]; + } + return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath]; + } @catch (NSException *exception) { + NSLog(@"Camera.resultForVideo: error retrieving file path"); + return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:[exception reason]]; } - return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath]; } - (NSString *) createTmpVideo:(NSString *) moviePath {