Skip to content

Commit ad5501a

Browse files
authored
Merge pull request #30576 from nextcloud/backport/30565/stable23
[stable23] Fix fail when keys/files folder already exists
2 parents 67fcbac + 9eeaed0 commit ad5501a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,11 @@ private function copyBetweenStorage(Storage\IStorage $sourceStorage, $sourceInte
768768

769769
if ($sourceStorage->is_dir($sourceInternalPath)) {
770770
$dh = $sourceStorage->opendir($sourceInternalPath);
771-
$result = $this->mkdir($targetInternalPath);
771+
if (!$this->is_dir($targetInternalPath)) {
772+
$result = $this->mkdir($targetInternalPath);
773+
} else {
774+
$result = true;
775+
}
772776
if (is_resource($dh)) {
773777
while ($result and ($file = readdir($dh)) !== false) {
774778
if (!Filesystem::isIgnoredDir($file)) {

0 commit comments

Comments
 (0)