Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when trying to load photo library assets with nil image url
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 facebook#15952 Differential Revision: D5835219 Pulled By: ericnakagawa fbshipit-source-id: 7be00a15e674a0905cf5c27c526ce9085d1b308f
- Loading branch information