From 2ae24361c5e0fc4aed9a321123bba8ca416a35ff Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Fri, 12 Jan 2018 00:02:51 -0800 Subject: [PATCH] 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 --- Libraries/CameraRoll/RCTCameraRollManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/CameraRoll/RCTCameraRollManager.m b/Libraries/CameraRoll/RCTCameraRollManager.m index 4b6a78bde2c21b..72e128d6ecad33 100644 --- a/Libraries/CameraRoll/RCTCameraRollManager.m +++ b/Libraries/CameraRoll/RCTCameraRollManager.m @@ -199,7 +199,7 @@ static void RCTResolvePromise(RCTPromiseResolveBlock resolve, @"group_name": [group valueForProperty:ALAssetsGroupPropertyName], @"image": @{ @"uri": uri, - @"filename" : filename, + @"filename" : filename ?: [NSNull null], @"height": @(dimensions.height), @"width": @(dimensions.width), @"isStored": @YES,