forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path@react-native-camera-roll+camera-roll+7.4.0.patch
34 lines (33 loc) · 1.78 KB
/
@react-native-camera-roll+camera-roll+7.4.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle b/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle
index 6891fa3..8397f95 100644
--- a/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle
+++ b/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle
@@ -81,7 +81,9 @@ def findNodeModulePath(baseDir, packageName) {
}
def resolveReactNativeDirectory() {
- def reactNative = file("${findNodeModulePath(rootProject.projectDir, "react-native")}")
+ def projectDir = this.hasProperty('reactNativeProject') ? this.reactNativeProject : rootProject.projectDir
+ def modulePath = file(projectDir);
+ def reactNative = file("${findNodeModulePath(modulePath, 'react-native')}")
if (reactNative.exists()) {
return reactNative
}
diff --git a/node_modules/@react-native-camera-roll/camera-roll/ios/RNCCameraRoll.mm b/node_modules/@react-native-camera-roll/camera-roll/ios/RNCCameraRoll.mm
index 4769d28..ef88a07 100644
--- a/node_modules/@react-native-camera-roll/camera-roll/ios/RNCCameraRoll.mm
+++ b/node_modules/@react-native-camera-roll/camera-roll/ios/RNCCameraRoll.mm
@@ -207,6 +207,14 @@ static void requestPhotoLibraryAccess(RCTPromiseRejectBlock reject, PhotosAuthor
options.fetchLimit = 1;
PHFetchResult<PHAsset *> *createdAsset = [PHAsset fetchAssetsWithLocalIdentifiers:@[placeholder.localIdentifier]
options:options];
+
+ if (![createdAsset isKindOfClass:[PHAsset class]]) {
+ resolve(@{
+ @"node": [NSNull null]
+ });
+ return;
+ }
+
if (createdAsset.count < 1) {
reject(kErrorUnableToSave, nil, nil);
return;