Skip to content

Commit

Permalink
Merge pull request #30565 from nextcloud/bugfix/30564/fix-mkdir-fail-…
Browse files Browse the repository at this point in the history
…when-keys-folder-exists

Fix fail when keys/files folder already exists
  • Loading branch information
PVince81 authored Jan 10, 2022
2 parents 8954e51 + be590df commit 5c7ab1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/private/Files/Storage/Wrapper/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,11 @@ private function copyBetweenStorage(Storage\IStorage $sourceStorage, $sourceInte

if ($sourceStorage->is_dir($sourceInternalPath)) {
$dh = $sourceStorage->opendir($sourceInternalPath);
$result = $this->mkdir($targetInternalPath);
if (!$this->is_dir($targetInternalPath)) {
$result = $this->mkdir($targetInternalPath);
} else {
$result = true;
}
if (is_resource($dh)) {
while ($result and ($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
Expand Down

0 comments on commit 5c7ab1f

Please sign in to comment.