File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
lib/private/Files/Storage/Wrapper Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -671,6 +671,8 @@ private function copyBetweenStorage(
671671 }
672672 }
673673 } else {
674+ $ source = false ;
675+ $ target = false ;
674676 try {
675677 $ source = $ sourceStorage ->fopen ($ sourceInternalPath , 'r ' );
676678 $ target = $ this ->fopen ($ targetInternalPath , 'w ' );
@@ -680,10 +682,10 @@ private function copyBetweenStorage(
680682 [, $ result ] = \OC_Helper::streamCopy ($ source , $ target );
681683 }
682684 } finally {
683- if (isset ( $ source ) && $ source !== false ) {
685+ if ($ source !== false ) {
684686 fclose ($ source );
685687 }
686- if (isset ( $ target ) && $ target !== false ) {
688+ if ($ target !== false ) {
687689 fclose ($ target );
688690 }
689691 }
Original file line number Diff line number Diff line change @@ -1185,6 +1185,9 @@ private function doTestCopyRenameFail($operation) {
11851185 $ storage2 ->method ('writeStream ' )
11861186 ->willThrowException (new GenericFileException ('Failed to copy stream ' ));
11871187
1188+ $ storage2 ->method ('fopen ' )
1189+ ->willReturn (false );
1190+
11881191 $ storage1 ->mkdir ('sub ' );
11891192 $ storage1 ->file_put_contents ('foo.txt ' , '0123456789ABCDEFGH ' );
11901193 $ storage1 ->mkdir ('dirtomove ' );
You can’t perform that action at this time.
0 commit comments