ソースを参照

added null check to path before creating a File

ihavenoface5 4 年 前
コミット
6e50a4e1d7
No account linked to committer's email address
共有1 個のファイルを変更した6 個の追加3 個の削除を含む
  1. 6
    3
      android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java

+ 6
- 3
android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java ファイルの表示

666
         }
666
         }
667
         else {
667
         else {
668
             path = normalizePath(path);
668
             path = normalizePath(path);
669
-            boolean exist = new File(path).exists();
670
-            boolean isDir = new File(path).isDirectory();
671
-            callback.invoke(exist, isDir);
669
+            if (path != null) {
670
+                boolean exist = new File(path).exists();
671
+                boolean isDir = new File(path).isDirectory();
672
+                callback.invoke(exist, isDir);
673
+            }
674
+            callback.invoke(false, false);
672
         }
675
         }
673
     }
676
     }
674
 
677