Merge pull request #19731 from nextcloud/fix/15455/dont_hanlde_deleted_shares

Don't try to format deleted shares
This commit is contained in:
Roeland Jago Douma 2020-03-02 14:10:03 +01:00 committed by GitHub
commit 64a29d01a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -768,6 +768,16 @@ class ShareAPIController extends OCSController {
$known = $formatted = $miniFormatted = []; $known = $formatted = $miniFormatted = [];
$resharingRight = false; $resharingRight = false;
foreach ($shares as $share) { foreach ($shares as $share) {
try {
$share->getNode();
} catch (NotFoundException $e) {
/*
* Ignore shares where we can't get the node
* For example delted shares
*/
continue;
}
if (in_array($share->getId(), $known) || $share->getSharedWith() === $this->currentUser) { if (in_array($share->getId(), $known) || $share->getSharedWith() === $this->currentUser) {
continue; continue;
} }