diff --git a/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java b/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java index b6cf7013e..ac9ce5669 100644 --- a/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java +++ b/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java @@ -372,6 +372,11 @@ public void getContentIntent(String mime, Promise promise) { @ReactMethod public void addCompleteDownload (ReadableMap config, Promise promise) { DownloadManager dm = (DownloadManager) RCTContext.getSystemService(RCTContext.DOWNLOAD_SERVICE); + if (config == null || !config.hasKey("path")) + { + promise.reject("EINVAL", "RNFetchblob.addCompleteDownload config or path missing."); + return; + } String path = RNFetchBlobFS.normalizePath(config.getString("path")); if(path == null) { promise.reject("EINVAL", "RNFetchblob.addCompleteDownload can not resolve URI:" + config.getString("path"));