diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index cf05e9bfbc398..00ef7e2426b9b 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -470,7 +470,8 @@ public function deleteFromSelf(IShare $share, $recipient) { } if (!$group->inGroup($user)) { - throw new ProviderException('Recipient not in receiving group'); + // nothing left to do + return; } // Try to fetch user specific share diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index f6ce4894dbbc5..40626bdb57134 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -1558,9 +1558,6 @@ public function testDeleteFromSelfGroupAlreadyCustomShare() { public function testDeleteFromSelfGroupUserNotInGroup() { - $this->expectException(\OC\Share20\Exception\ProviderException::class); - $this->expectExceptionMessage('Recipient not in receiving group'); - $qb = $this->dbConn->getQueryBuilder(); $stmt = $qb->insert('share') ->values([