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 @@ -813,6 +813,8 @@ private function copyBetweenStorage(
813813 }
814814 }
815815 } else {
816+ $ source = false ;
817+ $ target = false ;
816818 try {
817819 $ source = $ sourceStorage ->fopen ($ sourceInternalPath , 'r ' );
818820 $ target = $ this ->fopen ($ targetInternalPath , 'w ' );
@@ -822,10 +824,10 @@ private function copyBetweenStorage(
822824 [, $ result ] = \OC_Helper::streamCopy ($ source , $ target );
823825 }
824826 } finally {
825- if (isset ( $ source ) && $ source !== false ) {
827+ if ($ source !== false ) {
826828 fclose ($ source );
827829 }
828- if (isset ( $ target ) && $ target !== false ) {
830+ if ($ target !== false ) {
829831 fclose ($ target );
830832 }
831833 }
Original file line number Diff line number Diff line change @@ -1183,6 +1183,9 @@ private function doTestCopyRenameFail($operation) {
11831183 $ storage2 ->method ('writeStream ' )
11841184 ->willThrowException (new GenericFileException ('Failed to copy stream ' ));
11851185
1186+ $ storage2 ->method ('fopen ' )
1187+ ->willReturn (false );
1188+
11861189 $ storage1 ->mkdir ('sub ' );
11871190 $ storage1 ->file_put_contents ('foo.txt ' , '0123456789ABCDEFGH ' );
11881191 $ storage1 ->mkdir ('dirtomove ' );
You can’t perform that action at this time.
0 commit comments