File tree 1 file changed +14
-4
lines changed
android/src/main/java/com/RNFetchBlob
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -751,8 +751,13 @@ public void onReceive(Context context, Intent intent) {
751
751
Cursor c = dm .query (query );
752
752
// #236 unhandled null check for DownloadManager.query() return value
753
753
if (c == null ) {
754
- this .callback .invoke ("Download manager failed to download from " + this .url + ". Query was unsuccessful " , null , null );
755
- return ;
754
+ try {
755
+ this .callback .invoke ("Download manager failed to download from " + this .url + ". Query was unsuccessful " , null , null );
756
+ return ;
757
+ }
758
+ catch (Exception e ) {
759
+ return ;
760
+ }
756
761
}
757
762
758
763
String filePath = null ;
@@ -762,8 +767,13 @@ public void onReceive(Context context, Intent intent) {
762
767
// #297 handle failed request
763
768
int statusCode = c .getInt (c .getColumnIndex (DownloadManager .COLUMN_STATUS ));
764
769
if (statusCode == DownloadManager .STATUS_FAILED ) {
765
- this .callback .invoke ("Download manager failed to download from " + this .url + ". Status Code = " + statusCode , null , null );
766
- return ;
770
+ try {
771
+ this .callback .invoke ("Download manager failed to download from " + this .url + ". Query was unsuccessful " , null , null );
772
+ return ;
773
+ }
774
+ catch (Exception e ) {
775
+ return ;
776
+ }
767
777
}
768
778
String contentUri = c .getString (c .getColumnIndex (DownloadManager .COLUMN_LOCAL_URI ));
769
779
if ( contentUri != null &&
You can’t perform that action at this time.
0 commit comments