diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-03-30 12:59:40 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-30 20:26:29 +0000 |
commit | caec3a8ceec1d63ffbb8bc4bbab2c665501a8757 (patch) | |
tree | bb1b16ebaf3a3071b8d1d592a2358a05c3618fbb | |
parent | b2072cd6fca3302cd621ef849b8e5e59b42665a8 (diff) | |
download | nextcloud-server-caec3a8ceec1d63ffbb8bc4bbab2c665501a8757.tar.gz nextcloud-server-caec3a8ceec1d63ffbb8bc4bbab2c665501a8757.zip |
gracefully handle deleteFromSelf when share is already gone
- handling race conditions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 3 | ||||
-rw-r--r-- | tests/lib/Share20/DefaultShareProviderTest.php | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index cf05e9bfbc3..00ef7e2426b 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -470,7 +470,8 @@ class DefaultShareProvider implements IShareProvider { } 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 f6ce4894dbb..40626bdb571 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -1558,9 +1558,6 @@ class DefaultShareProviderTest extends \Test\TestCase { 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([ |