File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
android/src/main/java/com/RNFetchBlob Expand file tree Collapse file tree 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) {
751751 Cursor c = dm .query (query );
752752 // #236 unhandled null check for DownloadManager.query() return value
753753 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+ }
756761 }
757762
758763 String filePath = null ;
@@ -762,8 +767,13 @@ public void onReceive(Context context, Intent intent) {
762767 // #297 handle failed request
763768 int statusCode = c .getInt (c .getColumnIndex (DownloadManager .COLUMN_STATUS ));
764769 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+ }
767777 }
768778 String contentUri = c .getString (c .getColumnIndex (DownloadManager .COLUMN_LOCAL_URI ));
769779 if ( contentUri != null &&
You can’t perform that action at this time.
0 commit comments