Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
marcshilling committed Apr 12, 2017
1 parent bdcbb09 commit 3ac597a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ios/ImagePickerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,13 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
[fileManager removeItemAtURL:videoDestinationURL error:nil];
}

NSError *error = nil;
[fileManager moveItemAtURL:videoURL toURL:videoDestinationURL error:&error];
if (error) {
self.callback(@[@{@"error": error.localizedFailureReason}]);
return;
if (videoURL) { // Protect against reported crash
NSError *error = nil;
[fileManager moveItemAtURL:videoURL toURL:videoDestinationURL error:&error];
if (error) {
self.callback(@[@{@"error": error.localizedFailureReason}]);
return;
}
}
}

Expand Down

0 comments on commit 3ac597a

Please sign in to comment.