File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -422,9 +422,18 @@ internal bool Execute(
422422
423423 // Use single-threaded code path when requested or when there is only copy to make
424424 // (no need to create all the parallel infrastructure for that case).
425- bool success = parallelism == 1 || DestinationFiles . Length == 1
426- ? CopySingleThreaded ( copyFile , out destinationFilesSuccessfullyCopied )
427- : CopyParallel ( copyFile , parallelism , out destinationFilesSuccessfullyCopied ) ;
425+ bool success = false ;
426+
427+ try
428+ {
429+ success = parallelism == 1 || DestinationFiles . Length == 1
430+ ? CopySingleThreaded ( copyFile , out destinationFilesSuccessfullyCopied )
431+ : CopyParallel ( copyFile , parallelism , out destinationFilesSuccessfullyCopied ) ;
432+ }
433+ catch ( OperationCanceledException )
434+ {
435+ return false ;
436+ }
428437
429438 // copiedFiles contains only the copies that were successful.
430439 CopiedFiles = destinationFilesSuccessfullyCopied . ToArray ( ) ;
You can’t perform that action at this time.
0 commit comments