File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
android/capacitor/src/main/java/com/getcapacitor/plugin Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -579,23 +579,22 @@ private void _copy(PluginCall call, boolean doRename) {
579579 toObject .delete ();
580580
581581 assert fromObject != null ;
582- boolean modified = false ;
583582
584583 if (doRename ) {
585- modified = fromObject .renameTo (toObject );
584+ boolean modified = fromObject .renameTo (toObject );
585+ if (!modified ) {
586+ call .error ("Unable to rename, unknown reason" );
587+ return ;
588+ }
586589 } else {
587590 try {
588591 copyRecursively (fromObject , toObject );
589- modified = true ;
590- } catch (IOException ignored ) {
592+ } catch (IOException e ) {
593+ call .error ("Unable to perform action: " + e .getLocalizedMessage ());
594+ return ;
591595 }
592596 }
593597
594- if (!modified ) {
595- call .error ("Unable to perform action, unknown reason" );
596- return ;
597- }
598-
599598 call .success ();
600599 }
601600
You can’t perform that action at this time.
0 commit comments