aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Service/OwnershipTransferService.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Service/OwnershipTransferService.php')
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index d664163041f..b5d0ee315a1 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -215,6 +215,9 @@ class OwnershipTransferService {
return $shares;
}
+ /**
+ * @throws TransferOwnershipException
+ */
protected function transferFiles(string $sourceUid,
string $sourcePath,
string $finalTarget,
@@ -228,7 +231,9 @@ class OwnershipTransferService {
$view->mkdir($finalTarget);
$finalTarget = $finalTarget . '/' . basename($sourcePath);
}
- $view->rename($sourcePath, $finalTarget);
+ if ($view->rename($sourcePath, $finalTarget) === false) {
+ throw new TransferOwnershipException("Could not transfer files", 1);
+ }
if (!is_dir("$sourceUid/files")) {
// because the files folder is moved away we need to recreate it
$view->mkdir("$sourceUid/files");