Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ public void onReceive(Context context, Intent intent) {
// 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.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS));
if(statusCode == DownloadManager.STATUS_FAILED) {
try {
this.callback.invoke("Download manager failed to download from " + this.url + ". Query was unsuccessful ", null, null);
Expand All @@ -788,7 +788,7 @@ public void onReceive(Context context, Intent intent) {
return;
}
}
String contentUri = c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
String contentUri = c.getString(c.getColumnIndexOrThrow(DownloadManager.COLUMN_LOCAL_URI));
if ( contentUri != null &&
options.addAndroidDownloads.hasKey("mime") &&
options.addAndroidDownloads.getString("mime").contains("image")) {
Expand Down