Skip to content

Commit

Permalink
iOS: guard image picker logic to check for the right source type
Browse files Browse the repository at this point in the history
Summary:
The logic in the method is only relevant if the sourceType is `UIImagePickerControllerSourceTypeCamera`. So we guard it here, to prevent NSInvalidArgumentException.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D19184818

fbshipit-source-id: 5c99dabfaed23629e22fdc888263bd09e8768c88
  • Loading branch information
fkgozali authored and facebook-github-bot committed Dec 20, 2019
1 parent f871bba commit 5e9f4e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Libraries/CameraRoll/RCTImagePickerManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ - (void)_dismissPicker:(UIImagePickerController *)picker args:(NSArray *)args
- (void)cameraChanged:(NSNotification *)notification
{
for (UIImagePickerController *picker in _pickers) {
if (picker.sourceType != UIImagePickerControllerSourceTypeCamera) {
continue;
}
if ([picker isKindOfClass:[RCTImagePickerController class]]
&& ((RCTImagePickerController *)picker).unmirrorFrontFacingCamera
&& picker.cameraDevice == UIImagePickerControllerCameraDeviceFront) {
Expand Down

0 comments on commit 5e9f4e6

Please sign in to comment.