Browse Source

Merge pull request #120 from khaled-cliqz/master

Add check for null path in releaseCapture
Gaëtan Renaudeau 6 years ago
parent
commit
59b35c5a10
No account linked to committer's email address

+ 3
- 1
android/src/main/java/fr/greweb/reactnativeviewshot/RNViewShotModule.java View File

@@ -55,7 +55,9 @@ public class RNViewShotModule extends ReactContextBaseJavaModule {
55 55
 
56 56
     @ReactMethod
57 57
     public void releaseCapture(String uri) {
58
-        File file = new File(Uri.parse(uri).getPath());
58
+        final String path = Uri.parse(uri).getPath();
59
+        if (path == null) return;
60
+        File file = new File(path);
59 61
         if (!file.exists()) return;
60 62
         File parent = file.getParentFile();
61 63
         if (parent.equals(reactContext.getExternalCacheDir()) || parent.equals(reactContext.getCacheDir())) {