File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
android/src/main/java/com/RNFetchBlob Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -591,7 +591,17 @@ private void done(Response resp) {
591591// ignored.printStackTrace();
592592 }
593593
594- RNFetchBlobFileResp rnFetchBlobFileResp = (RNFetchBlobFileResp ) responseBody ;
594+ try {
595+ RNFetchBlobFileResp rnFetchBlobFileResp = (RNFetchBlobFileResp ) responseBody ;
596+ } catch (ClassCastException ex ) {
597+ // unexpected response type
598+ if (responseBody != null ) {
599+ callback .invoke ("Unexpected FileStorage response file: " + responseBody .string (), null );
600+ } else {
601+ callback .invoke ("Unexpected FileStorage response with no file." , null );
602+ }
603+ return ;
604+ }
595605
596606 if (rnFetchBlobFileResp != null && !rnFetchBlobFileResp .isDownloadComplete ()){
597607 callback .invoke ("Download interrupted." , null );
You can’t perform that action at this time.
0 commit comments