File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
android/src/main/java/com/rnfs Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -404,12 +404,14 @@ protected void onPostExecute (Exception ex) {
404404
405405 private class CopyFileTask extends AsyncTask <String , Void , Exception > {
406406 protected Exception doInBackground (String ... paths ) {
407+ InputStream in = null ;
408+ OutputStream out = null ;
407409 try {
408410 String filepath = paths [0 ];
409411 String destPath = paths [1 ];
410412
411- InputStream in = getInputStream (filepath );
412- OutputStream out = getOutputStream (destPath , false );
413+ in = getInputStream (filepath );
414+ out = getOutputStream (destPath , false );
413415
414416 byte [] buffer = new byte [1024 ];
415417 int length ;
@@ -420,12 +422,14 @@ protected Exception doInBackground(String... paths) {
420422 } catch (Exception ex ) {
421423 return ex ;
422424 } finally {
423- if (in != null ) {
424- in .close ();
425- }
426- if (out != null ) {
427- out .close ();
428- }
425+ try {
426+ if (in != null ) {
427+ in .close ();
428+ }
429+ if (out != null ) {
430+ out .close ();
431+ }
432+ } catch (Exception ignored ) { }
429433 }
430434 }
431435 }
You can’t perform that action at this time.
0 commit comments