Skip to content

Commit

Permalink
Fix crash in RCTImagePicker on iOS
Browse files Browse the repository at this point in the history
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
Mehdi Mulani authored and facebook-github-bot committed Jul 12, 2018
1 parent 7eb419d commit 934c50f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Libraries/CameraRoll/RCTImagePickerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 934c50f

Please sign in to comment.