Skip to content

Commit afa8549

Browse files
committed
fix(encryption): Fix TypeError when trying to decrypt unencrypted file
Signed-off-by: Côme Chilliet <[email protected]>
1 parent e8ee398 commit afa8549

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)