Merge pull request #29421 from nextcloud/backport/29400/stable20

[stable20] fixes an undefined index when getAccessList returns an empty array
This commit is contained in:
MichaIng 2021-10-24 20:18:23 +02:00 committed by GitHub
commit 8faaeda027
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,7 +140,7 @@ class File implements IEntity, IDisplayText, IUrl, IIcon, IContextPortation {
return true;
}
$acl = $this->shareManager->getAccessList($node, true, true);
return array_key_exists($uid, $acl['users']);
return isset($acl['users']) && array_key_exists($uid, $acl['users']);
} catch (NotFoundException $e) {
return false;
}