diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index f0cf3f45b15f6..db13a72e0bd2a 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1215,7 +1215,12 @@ protected function promoteReshares(IShare $share): void { foreach ($userIds as $userId) { foreach ($shareTypes as $shareType) { - $provider = $this->factory->getProviderForType($shareType); + try { + $provider = $this->factory->getProviderForType($shareType); + } catch (ProviderException $e) { + continue; + } + if ($node instanceof Folder) { /* We need to get all shares by this user to get subshares */ $shares = $provider->getSharesBy($userId, $shareType, null, false, -1, 0); diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index e69afda4ada9c..461bddf3db68e 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -2273,7 +2273,7 @@ public function testLinkCreateChecksReadOnly() { public function testPathCreateChecksContainsSharedMount() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('You cannot share a folder that contains other shares'); + $this->expectExceptionMessage('Path contains files shared with you'); $path = $this->createMock(Folder::class); $path->method('getPath')->willReturn('path');