Merge pull request #36441 from nextcloud/backport/36433/stable24

[stable24] fix(encryption): don't throw on missing file
This commit is contained in:
blizzz 2023-02-09 13:07:18 +01:00 committed by GitHub
commit 4d0a68eca1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -817,16 +817,13 @@ class Encryption extends Wrapper {
$source = $sourceStorage->fopen($sourceInternalPath, 'r');
$target = $this->fopen($targetInternalPath, 'w');
[, $result] = \OC_Helper::streamCopy($source, $target);
fclose($source);
fclose($target);
} catch (\Exception $e) {
} finally {
if (is_resource($source)) {
fclose($source);
}
if (is_resource($target)) {
fclose($target);
}
throw $e;
}
if ($result) {
if ($preserveMtime) {