Skip to content

Commit 6f06bef

Browse files
committed
fix(ios): handle video transcoding cancel exception
1 parent 6feaa95 commit 6f06bef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ios/CDVCamera.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,13 @@ - (void)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info comp
512512

513513
- (CDVPluginResult*)resultForVideo:(NSDictionary*)info
514514
{
515-
NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
516-
return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath];
515+
@try {
516+
NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
517+
return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath];
518+
} @catch (NSException *exception) {
519+
NSLog(@"Camera.resultForVideo: error retrieving file path");
520+
return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@""];
521+
}
517522
}
518523

519524
- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info

0 commit comments

Comments
 (0)