Skip to content

Commit 6e50a4e

Browse files
authored
added null check to path before creating a File
1 parent ffc372e commit 6e50a4e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,12 @@ static void exists(String path, Callback callback) {
666666
}
667667
else {
668668
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);
672675
}
673676
}
674677

0 commit comments

Comments
 (0)