iOS: Fix Crash when CameraRoll is getting assets from iCloud and no filename is provided. #13671

Summary:
RCTCameraRollManager.m crashes when there is no filename provided for the asset (usually from iCloud). #13671

Tested on real device with iCloud library using the library without and after my fix. It worked after my changes.

[IOS] [BUGFIX] [CameraRoll] - Changed the filename if nil to be empty when the asset is coming from iCloud.
Closes https://github.com/facebook/react-native/pull/17549

Differential Revision: D6710665

Pulled By: hramos

fbshipit-source-id: 319865b0a71728798c62ee380e7bee4af584b3e3
This commit is contained in:
Hristo Hristov 2018-01-12 00:02:51 -08:00 committed by Facebook Github Bot
parent 2afe7d4765
commit 2ae24361c5
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params
@"group_name": [group valueForProperty:ALAssetsGroupPropertyName], @"group_name": [group valueForProperty:ALAssetsGroupPropertyName],
@"image": @{ @"image": @{
@"uri": uri, @"uri": uri,
@"filename" : filename, @"filename" : filename ?: [NSNull null],
@"height": @(dimensions.height), @"height": @(dimensions.height),
@"width": @(dimensions.width), @"width": @(dimensions.width),
@"isStored": @YES, @"isStored": @YES,