Permalink
Browse files

Fix crash in RCTImagePicker on iOS

Summary:
@public
Apparently if you select images really quickly, the app will crash.

Reviewed By: shergin

Differential Revision: D8796730

fbshipit-source-id: 81a652d9c8997ee9e83bbee3378954a6718a9b5d
  • Loading branch information...
mmmulani authored and facebook-github-bot committed Jul 12, 2018
1 parent 7eb419d commit 934c50fbe07e49391ba27c3469f99bec65e48d39
Showing with 5 additions and 0 deletions.
  1. +5 −0 Libraries/CameraRoll/RCTImagePickerManager.m
@@ -153,6 +153,11 @@ - (void)_presentPicker:(UIImagePickerController *)imagePicker
- (void)_dismissPicker:(UIImagePickerController *)picker args:(NSArray *)args
{
NSUInteger index = [_pickers indexOfObject:picker];
if (index == NSNotFound) {
// This happens if the user selects multiple items in succession.
return;
}
RCTResponseSenderBlock successCallback = _pickerCallbacks[index];
RCTResponseSenderBlock cancelCallback = _pickerCancelCallbacks[index];

0 comments on commit 934c50f

Please sign in to comment.