7fab093fc8
Summary: This avoids a crash when we try to load a PHAsset with nil image url. Specifically, the following condition evaluates to true when `imageURL` is nil: ```objc if ([imageURL.scheme caseInsensitiveCompare:@"assets-library"] == NSOrderedSame) { assetID = [imageURL absoluteString]; results = [PHAsset fetchAssetsWithALAssetURLs:@[imageURL] options:nil]; } ``` The crash will be "attempt to insert nil object from objects[0]" when we build the `@[imageURL]` array literal. We've seen this emerge as a very common crash among Expo users, so I wanted to at least provide a clear error message instead of terminating the app. Load an image from the photo library with a nil request url. Closes https://github.com/facebook/react-native/pull/15952 Differential Revision: D5835219 Pulled By: ericnakagawa fbshipit-source-id: 7be00a15e674a0905cf5c27c526ce9085d1b308f |
||
---|---|---|
.. | ||
RCTCameraRoll.xcodeproj | ||
CameraRoll.js | ||
ImagePickerIOS.js | ||
RCTAssetsLibraryRequestHandler.h | ||
RCTAssetsLibraryRequestHandler.m | ||
RCTCameraRollManager.h | ||
RCTCameraRollManager.m | ||
RCTImagePickerManager.h | ||
RCTImagePickerManager.m | ||
RCTPhotoLibraryImageLoader.h | ||
RCTPhotoLibraryImageLoader.m |