mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix: skip transfering shares that we can't find
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
b16f5a0043
commit
c00724bac8
1 changed files with 13 additions and 4 deletions
|
|
@ -340,10 +340,19 @@ class OwnershipTransferService {
|
|||
$progress->finish();
|
||||
$output->writeln('');
|
||||
|
||||
return array_map(fn (IShare $share) => [
|
||||
'share' => $share,
|
||||
'suffix' => substr(Filesystem::normalizePath($view->getPath($share->getNodeId())), strlen($normalizedPath)),
|
||||
], $shares);
|
||||
return array_values(array_filter(array_map(function (IShare $share) use ($view, $normalizedPath, $output, $sourceUid) {
|
||||
try {
|
||||
$nodePath = $view->getPath($share->getNodeId());
|
||||
} catch (NotFoundException $e) {
|
||||
$output->writeln("<error>Failed to find path for shared file {$share->getNodeId()} for user $sourceUid, skipping</error>");
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
'share' => $share,
|
||||
'suffix' => substr(Filesystem::normalizePath($nodePath), strlen($normalizedPath)),
|
||||
];
|
||||
}, $shares)));
|
||||
}
|
||||
|
||||
private function collectIncomingShares(string $sourceUid,
|
||||
|
|
|
|||
Loading…
Reference in a new issue