Skip to content
Snippets Groups Projects
Unverified Commit 4d0a68ec authored by blizzz's avatar blizzz Committed by GitHub
Browse files

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

[stable24] fix(encryption): don't throw on missing file
parents 53c94353 18ca00b2
Branches
Tags
No related merge requests found
...@@ -817,16 +817,13 @@ class Encryption extends Wrapper { ...@@ -817,16 +817,13 @@ class Encryption extends Wrapper {
$source = $sourceStorage->fopen($sourceInternalPath, 'r'); $source = $sourceStorage->fopen($sourceInternalPath, 'r');
$target = $this->fopen($targetInternalPath, 'w'); $target = $this->fopen($targetInternalPath, 'w');
[, $result] = \OC_Helper::streamCopy($source, $target); [, $result] = \OC_Helper::streamCopy($source, $target);
fclose($source); } finally {
fclose($target);
} catch (\Exception $e) {
if (is_resource($source)) { if (is_resource($source)) {
fclose($source); fclose($source);
} }
if (is_resource($target)) { if (is_resource($target)) {
fclose($target); fclose($target);
} }
throw $e;
} }
if ($result) { if ($result) {
if ($preserveMtime) { if ($preserveMtime) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment