Skip to content

Commit a943720

Browse files
danxuliubackportbot[bot]
authored andcommitted
fix: Handle missing share providers when promoting reshares
The provider for mail shares is not available when the "sharebymail" app is disabled, and in that case a "ProviderException" is thrown when trying to get it. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 98b3a2e commit a943720

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/private/Share20/Manager.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,12 @@ protected function promoteReshares(IShare $share): void {
10651065

10661066
foreach ($userIds as $userId) {
10671067
foreach ($shareTypes as $shareType) {
1068-
$provider = $this->factory->getProviderForType($shareType);
1068+
try {
1069+
$provider = $this->factory->getProviderForType($shareType);
1070+
} catch (ProviderException $e) {
1071+
continue;
1072+
}
1073+
10691074
if ($node instanceof Folder) {
10701075
/* We need to get all shares by this user to get subshares */
10711076
$shares = $provider->getSharesBy($userId, $shareType, null, false, -1, 0);

0 commit comments

Comments
 (0)