Skip to content

Commit ca2f93d

Browse files
authored
Merge pull request wkh237#504 from Bhavik-P/checkKey
Check if addAndroidDownloads map has the notification key before consuming
2 parents d35f806 + d7dd38f commit ca2f93d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void run() {
160160
if (options.addAndroidDownloads.getBoolean("useDownloadManager")) {
161161
Uri uri = Uri.parse(url);
162162
DownloadManager.Request req = new DownloadManager.Request(uri);
163-
if(options.addAndroidDownloads.getBoolean("notification")) {
163+
if(options.addAndroidDownloads.hasKey("notification") && options.addAndroidDownloads.getBoolean("notification")) {
164164
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
165165
} else {
166166
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);

0 commit comments

Comments
 (0)