Skip to content

Commit dcf004a

Browse files
come-ncbackportbot[bot]
authored andcommitted
fix(encryption): Fix TypeError when trying to decrypt unencrypted file
Signed-off-by: Côme Chilliet <[email protected]>
1 parent 427a016 commit dcf004a

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
@@ -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
}

0 commit comments

Comments
 (0)