forked from wkh237/react-native-fetch-blob
-
Notifications
You must be signed in to change notification settings - Fork 791
Open
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch rn-fetch-blob@0.12.0
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java b/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
index a8abd71..990ad65 100644
--- a/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
+++ b/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
@@ -738,7 +738,9 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
// the file exists in media content database
if (c.moveToFirst()) {
// #297 handle failed request
- int statusCode = c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS));
+ //int statusCode = c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS));
+ int statusCol = c.getColumnIndex(DownloadManager.COLUMN_STATUS);
+ int statusCode = statusCol != -1 ? c.getInt(statusCol) : DownloadManager.STATUS_FAILED;
if(statusCode == DownloadManager.STATUS_FAILED) {
this.callback.invoke("Download manager failed to download from " + this.url + ". Status Code = " + statusCode, null, null);
return;
This issue body was partially generated by patch-package.
Metadata
Metadata
Assignees
Labels
No labels